From: Operating system: Windows 7 x64 PHP version: 5.3.4 Package: Scripting Engine problem Bug Type: Bug Bug description:T_LOGICAL_AND when declaring and() method in class
Description:
------------
When declaring a method named 'and' within a class, PHP throws a parse
error
because the function name is interpreted as a logical operator
(T_LOGICAL_AND).
This appears to be a bug, as it's clear in this context that the developer
is not
attempting to perform a comparison.
Test script:
---------------
<?php
class LogicalOperatorTest {
public function and() {
echo "successful!";
}
}
?>
Expected result:
----------------
The method LogicalOperatorTest->and() to be declared.
Actual result:
--------------
Parse error: syntax error, unexpected T_LOGICAL_AND, expecting T_STRING in
C:\pathto\lovely.php on line 5
--
Edit bug report at http://bugs.php.net/bug.php?id=53616&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53616&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53616&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53616&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53616&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53616&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53616&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53616&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53616&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53616&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53616&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53616&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53616&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53616&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53616&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53616&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53616&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53616&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53616&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53616&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53616&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53616&r=mysqlcfg
