Re: bug 48541 - critical for PHP 5.3

From: Date: Sat, 13 Jun 2009 11:17:29 +0000
Subject: Re: bug 48541 - critical for PHP 5.3
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-44260@lists.php.net to get a copy of this message
Hi Greg, > I can do it if someone can answer this question: how do closures > uniquely identify themselves? spl_autoload_register is mistakenly > treating all closures as if they were a single copy of the static method > "Closure::__invoke", and so only the first registered closure is ever > called (plus it leaks the other closures at shutdown). If the system > can be made to better identify the closure, then spl_autoload_register > can use that (and also properly free the refcount on a dupe). A closure can only be uniquely identified by the object storage id the object has. You cannot assume any identity with regard to, for example, file name and line where it was defined, since one could imagine the following: foreach ($dirs as $dir) { spl_autoload_register (function ($class) use ($dir) { include $dir.'/'.$class.'.php'; }); } (or something like it) If nobody else does it I'll fix this later today. Regards, Christian

« previous php.internals (#44260) next »