|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67222 Parent class static method passes wrong called_scope name to closure
Submitted: 2014-05-06 22:51 UTC Modified: 2014-05-08 18:06 UTC
Avg. Score:2.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: lonny at lonnylot dot com Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 5.5.12 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
36 + 34 = ?
Subscribe to this entry?

 [2014-05-06 22:51 UTC] lonny at lonnylot dot com
When a parent class has a static method with a closure in it is passes the wrong called_scope name (via self, static, get_called_class()) to the closure.

Test script:
class Foo
	public static function blah()
        $foo = function(){


class Bar extends Foo



Expected result:
string(3) "Bar"

Actual result:
string(3) "Foo"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-08 18:06 UTC]
-Status: Open +Status: Duplicate
 [2014-05-08 18:06 UTC]
This is a duplicate of bug 66622.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 11:03:35 2021 UTC