Edit report at https://bugs.php.net/bug.php?id=60305&edit=1

 ID:                 60305
 Comment by:         francois dot dambrine at isen-lille dot fr
 Reported by:        matty023 at gmail dot com
 Summary:            myClass::unset() keyword conflict
 Status:             Open
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 PHP Version:        5.4.0RC1
 Block user comment: N
 Private report:     N

 New Comment:

This bug also happen in php 5.3.6 (ubuntu 11.10 default version).


Previous Comments:
------------------------------------------------------------------------
[2011-11-15 02:19:37] matty023 at gmail dot com

Description:
------------
While "keywords" and "language constructs" cannot be used as function names, I 
find myself with the need to have a function in my class named "unset", I also 
see that list is a very common and useful term.

After the introduction of classes and namespaces it's time to look at enabling 
usage of these common terms in classes and namespaces.



Test script:
---------------
<?php
namespace whatever;
class unsetTest{
        function unset($whatever){
                
        }
}

Expected result:
----------------
Happiness

Actual result:
--------------
//Parse error: syntax error, unexpected 'unset' (T_UNSET), expecting identifier 
(T_STRING) in E:\_www\x.php on line #


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60305&edit=1

Reply via email to