Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35862 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73902 invoked by uid 1010); 29 Feb 2008 15:02:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 73887 invoked from network); 29 Feb 2008 15:02:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Feb 2008 15:02:34 -0000 Authentication-Results: pb1.pair.com header.from=thrthr@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=thrthr@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.157 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: thrthr@gmail.com X-Host-Fingerprint: 72.14.220.157 fg-out-1718.google.com Received: from [72.14.220.157] ([72.14.220.157:45015] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/01-64447-68E18C74 for ; Fri, 29 Feb 2008 10:02:30 -0500 Received: by fg-out-1718.google.com with SMTP id 22so2905789fge.23 for ; Fri, 29 Feb 2008 07:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=7F2uJfDtwbXALRgJW2x5PNcLNQ1lwQCRomkf1h/YmWM=; b=AXpNLhfgSHpDnvHSbsOAYuMrVTc1kRjPmV5v0U46+AeNwS+wB09z/uFN72ehzVjhwA3D+/80DDTXolUqk510357EoD/OnkdA5OSaVpWmaaYPc5RpXufUl0E2mQVVVw10Cu+cLgK3ioFackdit1biV8mhUa9GbW+qGflx9tZiELg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=AsAl7TS9ic3ocCqeoSokuuMgMsFDU5Zi4EfJV+fox74SKz2UObBCbqtFK32HIjNZSnGkorcSEXKnCHE5WzsYDYVBs/8Rc96AkdN99Vvjz2t+WW4S+h7rbtQdjZ+p/xodswLkp5wpxTWhjQMUH8JBF57PeOfVRbsv7KU6ryt8LIE= Received: by 10.86.76.16 with SMTP id y16mr10661642fga.23.1204297347161; Fri, 29 Feb 2008 07:02:27 -0800 (PST) Received: by 10.86.31.7 with HTTP; Fri, 29 Feb 2008 07:02:27 -0800 (PST) Message-ID: <8697e5310802290702g49ae2bcbs9e6478832072141a@mail.gmail.com> Date: Fri, 29 Feb 2008 16:02:27 +0100 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: PHP 5.3 Autoload+Namespaces+Functions incorret (atleast wierd) behaviour. From: thrthr@gmail.com ("=?ISO-8859-1?Q?Fredrik_Holmstr=F6m?=") So I've been messing around with the latest 5.3-dev builds on my localhost, after testing out the Namespace-feature in 5.3-dev by porting parts of my own framework to it I ran into some buggy (or atleast wierd) behaviour concerning autoload and functions inside namespaces. 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. I have included an example in the __autoload.zip (http://arenagrande.tv/__autoload.zip), containing 3 files, check the comment in demo.php for a better explenation. However, I can see why php would behave this way, since autoload was intended for classes and not functions, but imho. autoload should be made to work perfectly with namespaces aswell as classes.