php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47054 BC break in static functions called as dynamic
Submitted: 2009-01-09 15:20 UTC Modified: 2009-01-10 19:15 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: giovanni at giacobbi dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2009-01-09 (snap) OS: linux
Private report: No CVE-ID: None
 [2009-01-09 15:20 UTC] 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: 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-10 19:15 UTC] felipe@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC