|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-03 09:29 UTC] derick@php.net
[2004-01-03 10:05 UTC] manico-php at wdmedia dot net
[2004-04-27 23:47 UTC] jerome dot dury at cegedim dot fr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
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 />