#26776 [Opn->Bgs]: keywords parent:: and self:: do no more work in caps
| From: | derick@php.net | Date: | Sat, 03 Jan 2004 14:29:27 +0000 |
| Subject: | #26776 [Opn->Bgs]: keywords parent:: and self:: do no more work in caps | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52752@lists.php.net to get a copy of this message | ||
ID: 26776
Updated by: derick@php.net
Reported By: ganfset-php at dreams4net dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Linux
PHP Version: 5CVS-2004-01-03 (dev)
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
.
Previous Comments:
------------------------------------------------------------------------
[2004-01-03 09:13:50] ganfset-php at dreams4net dot com
Description:
------------
In PHP4 and first PHP5 betas you could ask a parent method form a
object with the following syntax : parent::method(). It was possible to
use parent:: or PARENT::
Use of caps is important as it make possible to better distinguish the
keyword from a classname
In the last betas (tested in php-5.0.0b3 and php5-200401031230)
PARENT:: in caps output an error (Fatal error: Class 'PARENT' not
found). Same error comes with SELF:: in caps (while parent:: and self::
are OK)
Reproduce code:
---------------
<?php
class foo {
function min() { echo "parent::method OK" ; }
function maj() { echo "PARENT::method OK" ; }
}
class bar extends foo {
function min() { parent::min() ; }
function maj() { PARENT::maj() ; }
}
$obj = new bar ;
$obj->min() ; // ok in PHP4 and last PHP5
echo "\n" ;
$obj->maj() ; // error on last PHP5 snaps
Expected result:
----------------
parent::method OK
PARENT::method OK
Actual result:
--------------
parent::method OK
<br />
<b>Fatal error</b>: Class 'PARENT' not found in <b>-</b> on line
<b>8</b><br />
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26776&edit=1