Bug #80764 [NEW]: method magic constant in closure loses class

From: Date: Wed, 17 Feb 2021 18:15:04 +0000
Subject: Bug #80764 [NEW]: method magic constant in closure loses class
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232227@lists.php.net to get a copy of this message
From: bernievbb at icloud dot com Operating system: macos PHP version: 8.0Git-2021-02-17 (Git) Package: *General Issues Bug Type: Bug Bug description:method magic constant in closure loses class Description: ------------ class and method are lost when __METHOD__ called in closure. Test script: --------------- <?php namespace pdox\pal; class test { function test1() { var_dump(__METHOD__); // string(21) "pdox\pal\test::test1" $a = function() {return __METHOD__;}; var_dump($a()); // string(18) "pdox\pal\{closure}" $b = fn() => __METHOD__; var_dump($b()); // string(18) "pdox\pal\{closure}" } }?> -- Edit bug report at https://bugs.php.net/bug.php?id=80764&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80764&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80764&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80764&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80764&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80764&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80764&r=support Expected behavior: https://bugs.php.net/fix.php?id=80764&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80764&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80764&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80764&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80764&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80764&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80764&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80764&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80764&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80764&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80764&r=mysqlcfg

« previous php.bugs (#232227) next »