Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35912 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87713 invoked from network); 3 Mar 2008 11:40:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2008 11:40:57 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:33050] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/0B-29055-9C3EBC74 for ; Mon, 03 Mar 2008 06:40:57 -0500 Received: (qmail 27797 invoked by uid 507); 3 Mar 2008 11:40:51 -0000 Received: from unknown (HELO ?192.168.1.101?) (postmaster%schlueters.de@82.135.15.45) by mail4.netbeat.de with ESMTPA; 3 Mar 2008 11:40:51 -0000 To: "\"=?ISO-8859-1?Q?Fredrik_Holmstr=F6m?=\"" Cc: internals@lists.php.net In-Reply-To: <8697e5310802290702g49ae2bcbs9e6478832072141a@mail.gmail.com> References: <8697e5310802290702g49ae2bcbs9e6478832072141a@mail.gmail.com> Content-Type: text/plain Date: Mon, 03 Mar 2008 12:40:52 +0100 Message-ID: <1204544452.3463.26.camel@goldfinger.johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-1.fc8) Content-Transfer-Encoding: 7bit Subject: Re: PHP 5.3 Autoload+Namespaces+Functions incorret (atleast wierd) behaviour. From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi Fredrik, On Fri, 2008-02-29 at 16:02 +0100, "=?ISO-8859-1?Q?Fredrik_Holmstr=F6m?=" wrote: > Basicly, the call is this: Demo::Functions::test(); where both Demo > and Functions are namespaces, and test() is a function inside the > Demo::Functions namespace. If you have an autoload handler here and > the file containing the Demo::Function::test()-decleration isn't > loaded, autoload will be called. > > Now everything seems fine, but the problem is that when the autoload > hooks have all fired php looks for the class Demo::Function, because > autoload seems to be interpreting the Demo::Function::test(); call as: > ::::, when it should be > ::::, and since the Function class > doesn't exist it will trigger a fatal error. autoload was designed for loading classes not functions. Wen resolving Demo::Function::test() and no function having that name is being found it's assumed that Demo is the namespace, function a class name in there and test a static method call. There's no way for the engine to see what else might be meant. So the result is expected and changing it woud mean to do major changes wich just creates new problems. johannes