Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39935 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96952 invoked from network); 13 Aug 2008 22:20:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2008 22:20:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:39157] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/A6-63398-04E53A84 for ; Wed, 13 Aug 2008 18:20:49 -0400 Received: from trainburn-lm.corp.yahoo.com (trainburn-lm.corp.yahoo.com [207.126.233.11]) (authenticated bits=0) by mail.lerdorf.com (8.14.3/8.14.3/Debian-5) with ESMTP id m7DMKivR028826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 13 Aug 2008 15:20:45 -0700 Message-ID: <48A35E3C.2040609@lerdorf.com> Date: Wed, 13 Aug 2008 15:20:44 -0700 User-Agent: Thunderbird/3.0a2pre (Macintosh; 2008071516) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Stanislav Malyshev , Marcus Boerger , internals@lists.php.net References: <909776579.20080803142659@marcus-boerger.de> <840985F2-A701-4BE4-91F6-F6B39048CF9B@pooteeweet.org> <48A09FF4.1030101@zend.com> <7f3ed2c30808111411t51553771j389f05c3436bc625@mail.gmail.com> <48A0C415.9090104@zend.com> <48A0D579.2000000@zend.com> <48A0DBAE.2010401@zend.com> <496879481.20080812153636@marcus-boerger.de> <279600845.20080812225135@marcus-boerger.de> <1218621323.4926.1.camel@localhost> <1341995942.20080813152134@marcus-boerger.de> <1218634532.4926.5.camel@localhost> <1714092517.20080813194342@marcus-boerger.de> <48A32817.4020105@zend.com> <10910129111.20080813213721@marcus-boerger.de> <48A33D86.1010806@zend.com> <59637275.20080813221213@marcus-boerger.de> <48A34180.8070601@zend.com> <0D64C8C4-2136-4D6B-9EBD-B5956C3044FC@pooteeweet.org> In-Reply-To: <0D64C8C4-2136-4D6B-9EBD-B5956C3044FC@pooteeweet.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mail.lerdorf.com [204.11.219.139]); Wed, 13 Aug 2008 15:20:45 -0700 (PDT) Subject: Re: [PHP-DEV] Inconsistencies in 5.3 From: rasmus@lerdorf.com (Rasmus Lerdorf) Lukas Kahwe Smith wrote: > > On 13.08.2008, at 22:18, Stanislav Malyshev wrote: > >> Simply include a script from two locations with different namespaces >> or one >>> >>> with namespace and the otherone without. >> >> I'm afraid you misunderstand how namespaces work. As I explained >> numerous times, namespaces are file-local, and this when including >> file, it does not matter a bit what was including context. > > I think Marcus is talking about files that are included that do not > specify a namespace explicitly. In this situation the context does matter. > > We do not know if the developer in question is aware that the context > would matter in this case. Actually like I said in a previous email it > would be nice to at least not throw a warning if the file that is > included specifies an explicit namespace (I assume that is possible?). > Maybe adding a new "include" is a solution. This way developers can say > explicitly what they want to do without having to suppress the warning. > Then again quickly some smartass developer is going to teach people that > these annoying warnings go away if you just use this new include > everywhere. Then again, I am not sure if I even have my head wrapped > around this entire namespace thing. Please, no new include. It's bad enough that we have 4 different ones as it is. The question here comes down to how we are going to teach people how namespaces work when they write code that might visually and logically be expected to add the included functions and classes to the namespace where in fact they won't. We can either throw warnings, as per Marcus' patch, or we can document the crap out of it. The warnings will force people to learn with the big drawback that there are many valid use cases and warnings in PHP, even if turned off via error_reporting, are quite expensive. So, without some sort of short-circuiting of our current error logic, which would break error_get_last(), I am against adding an E_NOTICE or an E_STRICT, for cases that might have a correct use. This is something we are going to have to think more about in PHP 6 because of all the new E_STRICTs. We might want to bite the bullet and change error_get_last to respect the error_reporting level, or perhaps just ignore E_STRICT when it isn't enabled. -Rasmus