From:             ganfset-php at dreams4net dot com
Operating system: Linux
PHP version:      5CVS-2004-01-03 (dev)
PHP Bug Type:     Class/Object related
Bug description:  keywords parent:: and self:: do no more work in caps

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 bug report at http://bugs.php.net/?id=26776&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26776&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26776&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26776&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26776&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26776&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26776&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26776&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26776&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26776&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26776&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26776&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26776&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26776&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26776&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26776&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26776&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26776&r=float

Reply via email to