Bug #70159 [Fbk->Csd]: __CLASS__ is lost in closures declared in classes
Edit report at https://bugs.php.net/bug.php?id=70159&edit=1
ID: 70159
Updated by: bwoebi@php.net
Reported by: jpauli@php.net
Summary: __CLASS__ is lost in closures declared in classes
-Status: Feedback
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: *
PHP Version: 7.0.0beta2
-Assigned To:
+Assigned To: bwoebi
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-07-28 14:31:37] jpauli@php.net
Please try using this snapshot:
http://snaps.php.net/php-trunk-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Fixed. Will be part of PHP7.0beta3
------------------------------------------------------------------------
[2015-07-28 14:28:17] jpauli@php.net
Description:
------------
If a closure is declared into a class, using __CLASS__ into this closure returns empty string
Test script:
---------------
class Foo
{
public function bar() {
return function () { var_dump(__CLASS__); };
}
}
(new Foo)->bar()();
Expected result:
----------------
"Foo"
Actual result:
--------------
""
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70159&edit=1
Thread (3 messages)