Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41413 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42753 invoked from network); 27 Oct 2008 04:16:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2008 04:16:39 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.92.24 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 74.125.92.24 qw-out-2122.google.com Received: from [74.125.92.24] ([74.125.92.24:17907] helo=qw-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/67-34199-5A045094 for ; Sun, 26 Oct 2008 23:16:38 -0500 Received: by qw-out-2122.google.com with SMTP id 8so857244qwh.59 for ; Sun, 26 Oct 2008 21:16:35 -0700 (PDT) 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:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=2P4dN0T1UTldbg0JdNzsDVGFXQTFHzuseH/Au8A8Zh4=; b=x7s2nDZ9eDgAz+6gD46dXcbxV+ZyZwOA3QlXc6I9DRuBm0xz6SE3PDot4J31LIZGT2 cdhhdK0oDyUy6ppkH1RTB8GjmrRh66YhymTvTY8IBjh6r7mvrQ6FJf0CW3LGxpm2wlsa MgrL62kSSOHXHgQa0RBeCIWbog6B6oVVZsw/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=UsRrDtN/Xsn8BKz160El4f7t6py8V6NUl6pknxalhNB2iSJv9C0KdaN0UeBRLqL6+Q cmylRQYQ9OP1r+NwSoOZ6Isb+3delrQkUXMmOJ3MMkefdG7iSJGSHb3c9ObuQfGPWi9D 5+x7M6bCkC1KgV5547JZgxZ/krvuPvmpDlXts= Received: by 10.214.80.11 with SMTP id d11mr1884980qab.133.1225080995260; Sun, 26 Oct 2008 21:16:35 -0700 (PDT) Received: by 10.214.78.6 with HTTP; Sun, 26 Oct 2008 21:16:35 -0700 (PDT) Message-ID: Date: Mon, 27 Oct 2008 02:16:35 -0200 To: "Greg Beaver" Cc: "Stan Vassilev | FM" , "PHP internals" In-Reply-To: <49048CCB.2090407@chiaraquartet.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46BD96DF-B594-490C-9812-D7ACDD976205@pooteeweet.org> <9373E34A42AC4CE0A65E512A61897512@pc> <49048CCB.2090407@chiaraquartet.net> Subject: Re: [PHP-DEV] From: guilhermeblanco@gmail.com ("Guilherme Blanco") Hi guys, I'm really interested to read the IRC conversation logs. Does anyone recorded it? Regards, On Sun, Oct 26, 2008 at 1:29 PM, Greg Beaver wrote: > Stan Vassilev | FM wrote: >> >> Hi, >> >> I want to thank you all for opting for the technically sound, clear and >> performant solution. Of course some users will never understand the >> precise reasons :: was avoided, but it's something we'll have to live >> with, given some past design choices in PHP. >> >> Regarding "foo\tbar" turning into "foo[tab]bar", I just wanted to throw >> it out there, although I don't think it's a great idea. We have only few >> escape combinations in string literals which can also be in a valid >> identifier: >> >> \t \n \r >> >> There are also some which aren't a problem since they can't be in a >> valid identifier: >> >> \x.. \0 \\ \$ \' \" \{..} etc. >> >> So the problem is with exactly three combos: \t, \n and \r. In the few >> places PHP takes class/function identifiers as strings, TAB, CR and LF >> could be interpolated back into the two characters they express, since >> TAB, CR and LF aren't valid on their own in identifiers, so ambiguity is >> not possible. > > there are other escape sequences (such as \f) > >> Those places of the top of my mind are: new $class(), $class::property, >> call_user_*(), _autoload, and all other places accepting callbacks. >> >> This would mean both of those will work correctly: "foo\\tbar" and >> "foo\tbar" when used as an identifier. >> >> Think of it as a plan B in case people cause a big fuss about it (which >> I think they won't: think about escaping of windows file paths and >> escaping in regex pattern, we're doing just fine there). > > I don't see this as a real problem, simply because when one makes a > mistake, it is obvious. A fatal error is displayed with the offending > class name/function name/constant name (yes, namespace constants die > with fatal error if they are not found, unlike traditional un-namespaced > constants). Although it may be possible to magically replace escaped > characters, this could have unintended side effects. For instance, if a > user is instantiating a class based on external input, it would > introduce a new way to have unexpected behavior, as newlines would be > converted to \n or \r. > > As I stated in my last message on the subject, the best approach for any > string is to always use single quotes. You're far less likely to run > into trouble. This has been true for years, and is not changed by > namespaces or any other addition in 5.3 > > Shall we let this one go? > > Greg > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: guilhermeblanco@hotmail.com URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil