Bug #70159 [Fbk->Csd]: __CLASS__ is lost in closures declared in classes

From: Date: Tue, 28 Jul 2015 16:15:52 +0000
Subject: Bug #70159 [Fbk->Csd]: __CLASS__ is lost in closures declared in classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194784@lists.php.net to get a copy of this message
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)

« previous php.bugs (#194784) next »