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

Reply via email to