Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85508 invoked from network); 16 Oct 2008 16:33:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Oct 2008 16:33:17 -0000 Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:45497] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/71-12818-ACC67F84 for ; Thu, 16 Oct 2008 12:33:16 -0400 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id B68BE4144009; Thu, 16 Oct 2008 16:34:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ne7Slzb8YnFc; Thu, 16 Oct 2008 18:34:48 +0200 (CEST) Received: from [192.168.0.151] (77-58-144-136.dclient.hispeed.ch [77.58.144.136]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 611564144058; Thu, 16 Oct 2008 18:34:46 +0200 (CEST) Cc: Greg Beaver , PHP Developers Mailing List Message-ID: <0C55B977-3835-4CB0-A23B-8AA684B71C18@pooteeweet.org> To: Stanislav Malyshev In-Reply-To: <48F75FA1.7020505@zend.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Thu, 16 Oct 2008 18:32:35 +0200 References: <48F653FF.5010106@chiaraquartet.net> <48F75FA1.7020505@zend.com> X-Mailer: Apple Mail (2.929.2) Subject: Re: [PHP-DEV] my last attempt at sanity with namespaces From: mls@pooteeweet.org (Lukas Kahwe Smith) On 16.10.2008, at 17:37, Stanislav Malyshev wrote: > B. There's a huge problem with this proposal which you seem > consistently to ignore despite all my attempts to explain it. Failed > autoload on each call is BAD. Very bad. It is not cacheable, it > leads to multiple disk accesses and it is absolutely undetectable to > the PHP user without the use of special tools. So making all > existing code contain this performance bomb unless you rewrite it is > very bad. It's better to have this code fail and provide simple > script to fix it in automatic fashion. The fix you propose - writing > use's - is not enough because as you noted later inertia would make > users not to use this code and thus have huge performance hit - > which most of them even wouldn't know where it came from. first up i am a bit irritated by the use of the term "internal class", i guess you both mean to say "class in the global namespaces"? > I talked to many OO developers and most of them were OK with > using :: on internal classes when using namespaces. second, we are not talking an issue where prepending with a double colon solves the issue, since example was about a case where i want to autoload a file that defines a class in the current namespace and not fall back to the global namespace. however your performance concerns are quite valid. imho the thing is, that the person who is developing a namespace that is autoloadable knows this (or should know this), as a result its his obligation to either trigger the autoload via a "use" statement or by prepending the current namespace name to the class name. imho the main use for namespaced code will be libraries and not application level code (with the exception that some people have mentioned that they might want to stick their templates in namespaces), so i think this burden is legit, since most of us spend their time writing application level code and not library code (sorry full time ezc/zf developers). so imho the solution is "none of the above". the solution is that however wants to make his namespaced code to be autoloadable must make sure he explicitly triggeres the autoloading. regards, Lukas Kahwe Smith mls@pooteeweet.org