Bug #73931 [NEW]: Can not rebind closures created from callables ...

From: Date: Sat, 14 Jan 2017 10:15:18 +0000
Subject: Bug #73931 [NEW]: Can not rebind closures created from callables ...
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206608@lists.php.net to get a copy of this message
From: php at sunyanzi dot me Operating system: Debian Jessie PHP version: 7.1.0 Package: *General Issues Bug Type: Bug Bug description:Can not rebind closures created from callables ... Description: ------------ Just see code ... $cl_foo is running correctly but $cl_bar not ... It seems that there's two types of Closure ... same name ... different behavior ... Actually I am not sure this is a bug or not ... get no clue reading the document ... Test script: --------------- <?php $foo = new class { private $in = 'this is foo'; public function func() { echo $this->cc; } }; $bar = new class { private $in = 'this is bar'; }; $cl_foo = Closure::fromCallable([ $foo, 'func' ]); $cl_bar = Closure::bind( $cl_foo, $bar ); Expected result: ---------------- this is bar // or "this is foo" ? Actual result: -------------- Cannot bind method class@anonymous::func() to object of class class@anonymous -- Edit bug report at https://bugs.php.net/bug.php?id=73931&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73931&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73931&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73931&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73931&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73931&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73931&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73931&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73931&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73931&r=support Expected behavior: https://bugs.php.net/fix.php?id=73931&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73931&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73931&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73931&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73931&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73931&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73931&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73931&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73931&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73931&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73931&r=mysqlcfg

« previous php.bugs (#206608) next »