Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44262 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23156 invoked from network); 13 Jun 2009 16:50:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jun 2009 16:50:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 209.85.222.204 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 209.85.222.204 mail-pz0-f204.google.com Received: from [209.85.222.204] ([209.85.222.204:47589] helo=mail-pz0-f204.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/D1-12802-DB8D33A4 for ; Sat, 13 Jun 2009 12:50:05 -0400 Received: by pzk42 with SMTP id 42so1805001pzk.29 for ; Sat, 13 Jun 2009 09:50:02 -0700 (PDT) Received: by 10.114.149.2 with SMTP id w2mr8080989wad.182.1244911802735; Sat, 13 Jun 2009 09:50:02 -0700 (PDT) Received: from monster.local ([76.84.30.125]) by mx.google.com with ESMTPS id m17sm2973171waf.38.2009.06.13.09.50.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Jun 2009 09:50:02 -0700 (PDT) Message-ID: <4A33D8B8.30203@chiaraquartet.net> Date: Sat, 13 Jun 2009 11:50:00 -0500 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Christian Seiler CC: PHP Developers Mailing List References: <4A3343A1.4060701@chiaraquartet.net> <4A338AC9.1090100@gmx.net> In-Reply-To: <4A338AC9.1090100@gmx.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] bug 48541 - critical for PHP 5.3 From: greg@chiaraquartet.net (Greg Beaver) Christian Seiler wrote: > 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. Hi, Thanks Christian, I've got a patch and a test I'm about to commit, would be great if you can review it. Thanks, Greg