Bug #70159 [Opn->Fbk]: __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: jpauli@php.net
Reported by: jpauli@php.net
Summary: __CLASS__ is lost in closures declared in classes
-Status: Open
+Status: Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: *
PHP Version: 7.0.0beta2
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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)