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

 ID:                 60304
 Updated by:         johan...@php.net
 Reported by:        matty023 at gmail dot com
 Summary:            Can't create class function myObject::unset()
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Win 7 64-bit
 PHP Version:        5.4.0RC1
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Keywords may not be used as identifiers.

http://php.net/manual/en/reserved.keywords.php


Previous Comments:
------------------------------------------------------------------------
[2011-11-15 01:09:39] matty023 at gmail dot com

Description:
------------
There is no way to create an "unset" function in a class even if the class is 
in it's own namespace.

This should be corrected/changed.

myObject->unset()
should not conflict with
unset()

Examples:

<?php

class unsetTest{
        function unset($whatever){
                
        }
}

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

==============================================

<?php
namespace whatever;
class unsetTest{
        function unset($whatever){
                
        }
}

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

Test script:
---------------
<?php

class unsetTest{
        function unset($whatever){
                
        }
}

Expected result:
----------------
A happy function in my class that will do what it is told.

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

Seemingly conflicting with the native PHP unset.


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



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

Reply via email to