Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44264 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32492 invoked from network); 13 Jun 2009 17:55:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jun 2009 17:55:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=chris_se@gmx.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chris_se@gmx.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.net designates 213.165.64.20 as permitted sender) X-PHP-List-Original-Sender: chris_se@gmx.net X-Host-Fingerprint: 213.165.64.20 mail.gmx.net Received: from [213.165.64.20] ([213.165.64.20:42633] helo=mail.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/A3-12802-A08E33A4 for ; Sat, 13 Jun 2009 13:55:23 -0400 Received: (qmail invoked by alias); 13 Jun 2009 17:55:19 -0000 Received: from p54A14DD4.dip.t-dialin.net (EHLO chris-se.dyndns.org) [84.161.77.212] by mail.gmx.net (mp009) with SMTP; 13 Jun 2009 19:55:19 +0200 X-Authenticated: #186999 X-Provags-ID: V01U2FsdGVkX1+Ho2xT0liHB6Ri6aBfXz4NkwNMW3jsVX5Ibv56CP nKCJYEsi36cERT Received: from [192.168.100.13] (cobalt.seiler.lan [192.168.100.13]) by chris-se.dyndns.org (Postfix) with ESMTP id 2500068FE; Sat, 13 Jun 2009 19:55:17 +0200 (CEST) Message-ID: <4A33E7D3.1050904@gmx.net> Date: Sat, 13 Jun 2009 19:54:27 +0200 User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: Greg Beaver CC: php-dev List References: <4A3343A1.4060701@chiaraquartet.net> <4A338AC9.1090100@gmx.net> <4A33D8B8.30203@chiaraquartet.net> <4A33DDDE.4070409@gmx.net> <4A33E2A2.4090305@chiaraquartet.net> In-Reply-To: <4A33E2A2.4090305@chiaraquartet.net> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 Subject: Re: [PHP-DEV] bug 48541 - critical for PHP 5.3 From: chris_se@gmx.net (Christian Seiler) Hi Greg, > (I meant commit when I said patch, sorry :) > > http://news.php.net/php.cvs/58696 > and > http://news.php.net/php.cvs/58697 Thanks, looks fine to me. However, I noticed that closures don't work with spl_autoload_unregister() and spl_autoload_functions(). Also, classes that define __invoke work with spl_autoload_functions() but not with spl_autoload_unregister() - unless array ($o, '__invoke') is given to spl_autoload_register() directly, then the same will work for unregister. Or, to sum it up: i) Real Closures $c = function ($class) { var_dump ('foo'); } spl_autoload_register ($c); var_dump (spl_autoload_functions ()); // '{closure}' spl_autoload_unregister ($c); // no effect ii) Invokables WORKS: dir = $dir; } public function __invoke ($class) { var_dump ("{$this->dir}/$class.php"); } } $al1 = new Autoloader ('d1'); $al2 = new Autoloader ('d2'); spl_autoload_register (array ($al1, '__invoke')); spl_autoload_register (array ($al2, '__invoke')); var_dump (spl_autoload_functions ()); spl_autoload_unregister (array ($al1, '__invoke')); $x = new Test; ?> SEMI-WORKS: dir = $dir; } public function __invoke ($class) { var_dump ("{$this->dir}/$class.php"); } } $al1 = new Autoloader ('d1'); $al2 = new Autoloader ('d2'); spl_autoload_register ($al1); spl_autoload_register ($al2); var_dump (spl_autoload_functions ()); // gives array ($object, '__invoke') instead of // directly $object - but that's at least equivalent spl_autoload_unregister ($al1); // no effect spl_autoload_unregister (array ($al1, '__invoke')); // no effect $x = new Test; ?> Regards, Christian