Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38893 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39451 invoked from network); 10 Jul 2008 08:14:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2008 08:14:28 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:5930] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/0A-24522-1E4C5784 for ; Thu, 10 Jul 2008 04:14:27 -0400 Received: from ws.home ([10.1.1.1]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Jul 2008 11:14:47 +0300 Message-ID: <4875C4DC.5020003@zend.com> Date: Thu, 10 Jul 2008 12:14:20 +0400 User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Gergely Hodicska CC: "internals@lists.php.net" References: <4875821E.9020504@avalon.aut.bme.hu> In-Reply-To: <4875821E.9020504@avalon.aut.bme.hu> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 10 Jul 2008 08:14:47.0281 (UTC) FILETIME=[045C9610:01C8E265] Subject: Re: [PHP-DEV] strange autoload behavior From: dmitry@zend.com (Dmitry Stogov) I have "Fatal error: Class 'Foo' not found" which is expected. Thanks. Dmitry. Gergely Hodicska wrote: > Hi! > > > I think I found a bug but before posing it to bugs.php.net I would like > to ask your opinion. I think the it is not a planed behavior that some > errors doesn't "bubble up" from autoload, but at least the error message > is misleading. > > --------------------------------------------- > foo.php: > throw new Exception(); > class foo {} > ?> > > bar.php: > class bar extends foo {} > ?> > > bootstrap.php > function __autoload($className) > { > include $className.'.php'; > } > new bar(); > ?> > --------------------------------------------- > Result: "Fatal error: Class 'bar' not found". > > > The code above seems not to be too realistic but the next one is: > --------------------------------------------- > foo.php: > define('error', oops_i_left_the_quotes); > class foo {} > ?> > > bar.php: > class bar extends foo {} > ?> > > bootstrap.php > function __autoload($className) > { > include $className.'.php'; > } > function error_handler() > { > throw new Exception(); > } > set_error_handler("error_handler"); > new bar(); > ?> > --------------------------------------------- > Result: "Fatal error: Class 'bar' not found". > > > And for example if define a class level constant without quotes I get > the exception generated by the Notice. > > > Best Regards, > Felhő > >