Bug #14178 Updated: PHP global function and class method names conflict
| From: | derick@php.net | Date: | Thu, 22 Nov 2001 15:41:00 +0000 |
| Subject: | Bug #14178 Updated: PHP global function and class method names conflict | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71394@lists.php.net to get a copy of this message | ||
ID: 14178
Updated by: derick
Reported By: jmmolina@ifrance.com
Old Status: Open
Status: Bogus
Bug Type: Class/Object related
Operating System: Windows
PHP Version: 4.0.6
New Comment:
print is a reserved word in PHP (not a real function), you can not use this as a function name.
Not a bug -> bogus
Previous Comments:
------------------------------------------------------------------------
[2001-11-22 10:36:19] jmmolina@ifrance.com
It seems that class methods are not really part of the class. The scope of
a method definition is global not local to the class. I have tried the
following:
class CMyClass
{
function Print ()
{
}
}
It doesn't work because the PHP parser thinks that the "Print"
method is the "print" PHP global function. I have tried to force
scope:
class CMyClass
{
function CMyClass::Print ()
{
}
}
But it doesn't work. The only solution I found is to use an other name for
my method, even if it really prints something.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14178&edit=1