Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98856 invoked from network); 3 Mar 2008 12:56:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2008 12:56:03 -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:50994] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/1D-29055-265FBC74 for ; Mon, 03 Mar 2008 07:56:03 -0500 Received: (qmail 21346 invoked by uid 507); 3 Mar 2008 12:55:58 -0000 Received: from unknown (HELO ?192.168.1.101?) (postmaster%schlueters.de@82.135.10.41) by mail4.netbeat.de with ESMTPA; 3 Mar 2008 12:55:58 -0000 To: Marcus Boerger Cc: "\"Fredrik" =?ISO-8859-1?Q?Holmstr=F6m=22?= , internals@lists.php.net In-Reply-To: <142480450.20080303132755@marcus-boerger.de> References: <8697e5310802290702g49ae2bcbs9e6478832072141a@mail.gmail.com> <1204544452.3463.26.camel@goldfinger.johannes.nop> <142480450.20080303132755@marcus-boerger.de> Content-Type: text/plain Date: Mon, 03 Mar 2008 13:55:53 +0100 Message-ID: <1204548953.3463.38.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-DEV] Re: PHP 5.3 Autoload+Namespaces+Functions incorret (atleast wierd) behaviour. From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi Marcus, On Mon, 2008-03-03 at 13:27 +0100, Marcus Boerger wrote: > new namespace::class() > new namaespace::namedspace::class() > > and so on, or: > > namespace::class::functoin() > namespace::function() > > and so on. That is, when detecting braces after it and a new in front > than it is a class. If there is no new in front it must be a function and > autoload needs to be called for all but the last part. With new it needs > to be called for all parts. Since the compiler already knows whether it > generates a ctor call we must have an issue that should be fixable. new in front is easy but take you're last example: ns::func() How can we detect, that we don't look for a class called "ns" with a (static) method "func" but for a namespace "ns" with a regular function called "func"? We do the lookup for "ns::func" in the function table, then a class lookup for "ns" and then trigger autoload... So the declaration for the thing called above could either look like or like And since we do only autoloading of classes, not functions, the autoload is only triggered looking for the second case. Every approach which might be cleverer would, imo, need some list of known namespaces which the current design doesn't have at all. johannes