Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60830 invoked by uid 1010); 7 Sep 2007 15:20:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 60815 invoked from network); 7 Sep 2007 15:20:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2007 15:20:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois.laupretre@ratp.fr; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=francois.laupretre@ratp.fr; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ratp.fr from 62.160.169.9 cause and error) X-PHP-List-Original-Sender: francois.laupretre@ratp.fr X-Host-Fingerprint: 62.160.169.9 odii-smtp1.ratp.fr Solaris 8 (2) Received: from [62.160.169.9] ([62.160.169.9:13716] helo=odii-smtp.ratp.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/0B-29055-15C61E64 for ; Fri, 07 Sep 2007 11:20:50 -0400 Received: from bl03ic06.info.ratp (unknown [188.20.209.10]) by odii-smtp.ratp.fr (Postfix) with ESMTP id 70BEE11F642; Fri, 7 Sep 2007 17:20:45 +0200 (MEST) Received: from EXCHANGE04.info.ratp ([188.20.209.2]) by bl03ic06.info.ratp with Microsoft SMTPSVC(6.0.3790.2499); Fri, 7 Sep 2007 17:19:47 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 7 Sep 2007 17:19:47 +0200 Message-ID: In-Reply-To: <000f01c7e871$9be827e0$6e02a8c0@thinkpad> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Namespaces and __autoload() Thread-Index: AcfoceMNGf634FExQmimAOMT4wanBwI7AzAw To: "Dmitry Stogov" Cc: "PHP Internals List" X-OriginalArrivalTime: 07 Sep 2007 15:19:47.0594 (UTC) FILETIME=[86EA4EA0:01C7F162] Subject: RE : [PHP-DEV] Namespaces and __autoload() From: francois.laupretre@ratp.fr (=?iso-8859-1?Q?LAUPRETRE_Fran=E7ois_=28P=29?=) References: <000f01c7e871$9be827e0$6e02a8c0@thinkpad> Hi, > From: Dmitry Stogov [mailto:dmitry@zend.com]=20 >=20 > The patch provides an additional boolean argument to=20 > __autoload() that say if class is really required. In case if=20 > it false, user code shouldn't emit errors or throw exceptions. Actually, an autoload handler should never emit errors or throw = exceptions. With handlers registered through SPL, it is already the = case. When using an __autoload() functions, raising an error when a = symbol is not found is useless because we know that the PHP interpreter = will do it. So, I propose to have PHP ignore any error or exception = raised from autoload handlers. This would make the additional argument = useless. Actually, I also wanted to add a second argument to autoload handlers. = It would give the type of the symbol we are looking for. Today, we are = unable to know if we are searching for a class or an interface. So, an = autoload handler like PHK's has to try both. It is not very important = because most existing autoload handlers are so primitive (generally = filename-based) that they treat both the same way. But, in the future, = if we extend autoloading to functions and constants, we will need this = argument. I cannot work on that now but, as you are considering = modifying the autoload handler arguments, I thought you could be = interested. Regards Francois