#47054 [Opn->Csd]: BC break in static functions called as dynamic
ID: 47054
Updated by: felipe@php.net
Reported By: giovanni at giacobbi dot net
-Status: Open
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 5.3CVS-2009-01-09 (snap)
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-01-09 15:20:30] giovanni at giacobbi dot net
Description:
------------
See the example code, should be self explanatory. The same code *works
as expected* in php5.3-alpha3, but does not with php5.3-200901091330.
Reproduce code:
---------------
class C {
final protected static function s() {
print "Called class: " . get_called_class() . "\n";
}
}
class D extends C {
public function m() {
$this->s();
}
}
$d = new D();
$d->m();
Expected result:
----------------
Called class: D
Actual result:
--------------
Warning: get_called_class() called from outside a class in
/home/johnny/build/php5.3-200901091330/- on line 4
Called class:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47054&edit=1
Thread (2 messages)