Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82942 invoked from network); 26 Nov 2011 02:58:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2011 02:58:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.26 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.26 out2.smtp.messagingengine.com Received: from [66.111.4.26] ([66.111.4.26:49726] helo=out2.smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/B6-47501-CE550DE4 for ; Fri, 25 Nov 2011 21:58:53 -0500 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id A288B20484 for ; Fri, 25 Nov 2011 21:58:50 -0500 (EST) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 25 Nov 2011 21:58:50 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=9/M4n49gJpwMdSZMU7XG3o Cd6Do=; b=BbayDDpfiKSdJ/a3190RAxaJNF1QIgI04J4fl7M5U8E213SPCApWbt scBN5xoQ2H3rtw/E8we/o27SSnaSAMRIWbfBjw+6N0FNUPyyisMX8PnILAeuNEEI Mr1w5EY/0qlgJxIiUwj1l2WzWxMwTtumlgEJJyKsqzodVP3p3xJwQ= X-Sasl-enc: i+I+9E/W3eOJ3pOmxz4x3QQOKiP/8Hme3lOohDT8kvKc 1322276330 Received: from [192.168.42.6] (c-24-13-85-162.hsd1.il.comcast.net [24.13.85.162]) by mail.messagingengine.com (Postfix) with ESMTPSA id 65BA8482490 for ; Fri, 25 Nov 2011 21:58:50 -0500 (EST) Message-ID: <4ED055E9.2090809@garfieldtech.com> Date: Fri, 25 Nov 2011 20:58:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: internals@lists.php.net References: <4ECEC513.9040706@mohiva.com> <06acba1a1c53ac9527beb807787c92aa@mohiva.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling From: larry@garfieldtech.com (Larry Garfield) On 11/25/2011 04:21 AM, Sebastian Krebs wrote: > 2011/11/25 Ferenc Kovacs > >> The problem with fatal, that you have no way (by the standard means, but >> you can somehow manage it through the usage of output buffers or >> register_shutdown_function, but thats ugly, and can change in the future) >> to intercept and gracefully terminate your application, which is an often >> needed feature. >> AFAIK E_FATAL should be only used where the engine is left in an unstable >> state, which isn't really true here. >> > > Trying to interact with a non-existing class is not an unstable state? > > there are two situations: > > 1. The application is broken, thus the FATAL is appropriate > 2. The application tries to work with dynamic class names. If it doesn't > use class_exists() before, its broken and FATAL is appropriate > > > So I think that E_RECOVERABLE_ERROR would be more appropriate here, and in There's a third possibility. 3) The application uses a mapped or indexed autoloader and the map is out of date. Rebuilding the map would resolve the error. So I could see a use for a recovery there; if new NonExistentClass fails, try to rebuild the index and try again before fataling out entirely. Whether that's too much of an edge case or not, I don't know, but it is a legitimate use case. (Drupal 7 has an indexed autoloader, and we've run into the stale index problem many times. We're trying to migrate most code to PSR-0 for Drupal 8, but even that could use an index for caching/performance reasons.) --Larry Garfield