Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38887 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80994 invoked from network); 10 Jul 2008 04:54:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2008 04:54:25 -0000 Authentication-Results: pb1.pair.com header.from=danielc@analysisandsolutions.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danielc@analysisandsolutions.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain analysisandsolutions.com from 166.84.1.72 cause and error) X-PHP-List-Original-Sender: danielc@analysisandsolutions.com X-Host-Fingerprint: 166.84.1.72 mail1.panix.com Received: from [166.84.1.72] ([166.84.1.72:62123] helo=mail1.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/8E-30205-FF595784 for ; Thu, 10 Jul 2008 00:54:24 -0400 Received: from panix3.panix.com (panix3.panix.com [166.84.1.3]) by mail1.panix.com (Postfix) with ESMTP id CEBC729409; Thu, 10 Jul 2008 00:54:18 -0400 (EDT) Received: (from analysis@localhost) by panix3.panix.com (8.11.6p3/8.8.8/PanixN1.1) id m6A4sIJ16793; Thu, 10 Jul 2008 00:54:18 -0400 (EDT) Date: Thu, 10 Jul 2008 00:54:18 -0400 To: Gergely Hodicska Cc: "internals@lists.php.net" Message-ID: <20080710045418.GA22262@panix.com> References: <4875821E.9020504@avalon.aut.bme.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4875821E.9020504@avalon.aut.bme.hu> User-Agent: Mutt/1.5.10i Subject: Re: [PHP-DEV] strange autoload behavior From: danielc@analysisandsolutions.com (Daniel Convissor) Hi Gergely: > foo.php: > throw new Exception(); > class foo {} > > bar.php: > class bar extends foo {} > > 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". The fact that the class "bar" is not found indicates that your include in the autoload is either totally failing or gathering some other files. Make your life better by specifying the path in the include statement rather than relying on the include_path. Also, you would have known this on your own if you better utilized the error handler: function error_handler($errno, $errstr, $errfile, $errline) { echo "survey says... $errstr
\n"; } --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409