Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70082 invoked from network); 5 Nov 2008 19:35:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2008 19:35:38 -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:60177] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/90-22938-885F1194 for ; Wed, 05 Nov 2008 14:35:38 -0500 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id B798E4144058; Wed, 5 Nov 2008 19:36:27 +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 Ca0SAZeWyqP2; Wed, 5 Nov 2008 20:36:26 +0100 (CET) Received: from [192.168.0.151] (77-58-151-147.dclient.hispeed.ch [77.58.151.147]) (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 64F404144009; Wed, 5 Nov 2008 20:36:24 +0100 (CET) Cc: Marcus Boerger , Gregory Beaver , Christian Schneider , PHP Development Message-ID: <02297291-ADDF-4AA1-897C-607B93980A32@pooteeweet.org> To: Stanislav Malyshev In-Reply-To: <4910E33C.2070609@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: Wed, 5 Nov 2008 20:34:26 +0100 References: <49048EC1.9060908@chiaraquartet.net> <49061E01.8060503@zend.com> <11c607a60810271344i1a8cf53fl149447ad2f687f99@mail.gmail.com> <490628DB.9060209@zend.com> <11c607a60810271422l68949427pe31786275b0b152c@mail.gmail.com> <08747094-6B50-4A0D-9057-DFD12108B6C6@caedmon.net> <94CCB864-179A-48DA-A89A-3859796A9257@pooteeweet.org> <49063A1D.7070804@zend.com> <4906405F.7090205@zend.com> <490747B2.2010201@zend.com> <4D9A8597-EFE6-418A-B7F6-EAD9ED2361A5@pooteeweet.org> <7FA6946B-57B9-4BC0-B2F1-AFD47572F363@pooteeweet.org> <491071EC.7020501@cschneid.com> <49107527.7060604@chiaraquartet.net> <1652368155.20081105001225@marcus-boerger.de> <6246E5E0-BD11-48E2-B32B-DA7F82E605E2@pooteeweet.org> <885621138.20081105004925@marcus-boerger.de> <4910E33C.2070609@zend.com> X-Mailer: Apple Mail (2.929.2) Subject: Re: [PHP-DEV] namespace separator and whining From: mls@pooteeweet.org (Lukas Kahwe Smith) On 05.11.2008, at 01:05, Stanislav Malyshev wrote: > Hi! > >> or in other words give the user the ability to specify when he >> wants the >> fallback to global and not doing a fallback to global per default. >> That way > > This would be quite complex thing since this way you can't be sure > which class gets loaded when you say, e.g., Exception - and thus, if > you write something like "throw new Exception("XML did not load")" > and except My\XML\Parser\Exception and have catch for it but get > just Exception your application would happily unroll to the top and > fail. > > I think actually knowing what class is going to be loaded is a good > idea and overriding loader behavior so it's asked for one class and > loads completely different one is not a good idea. One would expect > if he asks for class X he gets class X, not class Y. Well, its not like the person is getting Y when he is expecting X. Both classes have the same name after all, so there is some relation between these two classes. More importantly its the users choice to enable this in __autoload(). As all frameworks got that its the end users job to implement autoload, I would not worry soo much in this case. Just a question: How hard would it be to implement in case we do want this? regards, Lukas Kahwe Smith mls@pooteeweet.org