|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-11-07 08:31 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2015-11-07 08:31 UTC] nikic@php.net
[2015-11-07 08:50 UTC] info at mbcraft dot it
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Description: ------------ The closure is simply not rebound as described by the language specification using the bindTo function. Test script: --------------- <?php class A { private $my_string; public function __construct($st) { $this->my_string = $st; } public function launch() { return function() { echo $this->my_string."\n"; }; } } $a = new A("go"); $fn = $a->launch(); $fn(); $a2 = new A("ppppp"); $fn->bindTo($a2); $fn(); Expected result: ---------------- go ppppp Actual result: -------------- go go