RE: [PHP-DEV] </endnamespacediscussion>
| From: | Catalin Zamfir Alexandru | KIT Software CAZ | Date: | Sun, 26 Oct 2008 08:30:00 +0000 |
| Subject: | RE: [PHP-DEV] </endnamespacediscussion> | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41378@lists.php.net to get a copy of this message | ||
Ok, for short: "Cry havoc, and let loose the dogs of war." The fact that
they chose '\' instead of ::: or anything else is going to be a killer to
teach for novice PHP devs.
Just my 0.02$ ...
> -----Original Message-----
> From: Stan Vassilev | FM [mailto:sv_forums@fmethod.com]
> Sent: Sunday, October 26, 2008 10:04 AM
> To: PHP internals
> Subject: Re: [PHP-DEV] </endnamespacediscussion>
>
>
> 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.
>
> 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).
>
> Regards,
> Stan Vassilev
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php