Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32623 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75436 invoked by uid 1010); 3 Oct 2007 23:14:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75421 invoked from network); 3 Oct 2007 23:14:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2007 23:14:04 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:38756] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/16-38275-C3224074 for ; Wed, 03 Oct 2007 19:14:04 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id DB9A9C0E6D8; Wed, 3 Oct 2007 16:13:58 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-5-144.neb.res.rr.com [76.84.5.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 11011C0E6D7; Wed, 3 Oct 2007 16:13:57 -0700 (MST) Message-ID: <47042302.8000008@chiaraquartet.net> Date: Wed, 03 Oct 2007 18:17:22 -0500 User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: Stanislav Malyshev CC: internals Mailing List References: <470334FE.7050808@chiaraquartet.net> <47040F7A.6050207@zend.com> In-Reply-To: <47040F7A.6050207@zend.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] [PATCH] in_class_exists() for detecting __autoload() called by class_exists() and interface_exists() From: greg@chiaraquartet.net (Gregory Beaver) Stanislav Malyshev wrote: >> to use die() or some other method of terminating execution. A user >> calling class_exists() clearly expects a return from autoload, whereas a >> user instantiating an object will expect a fatal error if the class >> cannot be found. > > This is true, but __autoload should never do it, the engine should do > it. So I think it's better just not make autoloader *ever* produce > errors. Can't find it - just give up, if engine really needs it it'd > bail out :) Another possibility: could there be a way to add context information (a string) to the error message the engine displays? This would alleviate my concern. >> This is useful for PEAR2 as a means of displaying helpful information on >> locating missing class files only in cases where a fatal error would >> result anyways. > > Well, autoloader might print debug traces etc. if the developer wants > it, but I don't see why this should be unique feature for class_exists. the point is that if the user is using class_exists() they don't want extra output on missing class. Greg