RE: [PHP-DEV] POSIX regex

From: Date: Fri, 20 Jul 2007 02:31:01 +0000
Subject: RE: [PHP-DEV] POSIX regex
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-31127@lists.php.net to get a copy of this message
Just as an additional note ... God forbid you ever have to make some kind of change to all or most of your unicode strings that use "u" -- You can't exactly do a "Find in Files" for "u" and expect to not sift through a LOT of results that aren't what you're looking for. Even searching for u" (to denote the u right before the opening quote) would still bring back a ton of white noise in a good number of applications that I've seen. Jeremy -----Original Message----- From: david.coallier@gmail.com [mailto:david.coallier@gmail.com] On Behalf Of David Coallier Sent: Thursday, July 19, 2007 8:19 PM To: Stanislav Malyshev Cc: scott.mcnaught@synergy8.com; internals@lists.php.net Subject: Re: [PHP-DEV] POSIX regex On 7/19/07, Stanislav Malyshev <stas@zend.com> wrote: > > Yeah I also like that casting better than the "u" > > It's different things. Casting means "create string as binary, then in > runtime cast it to unicode", u"" means "this string is unicode". > -- You are right that casting means string -> binary, and that runtime cast to unicode means a string is unicode, however, after speaking with many php developers (not internals), the same answer always come up "It's ugly". Does that simply mean that it's ugly ? I believe not, it means that it's also unreadable, unclear at first look, and easy to overlook. One solution that I could foresee would be to recognize (unicode) within a function call. Ex: strlen( (unicode) "Óglaig"); This would runtime-cast Óglaig to a "unicode string". Expected answers: 1) I don't find it to be useful and better than "u" A: It is more readable, easier to find/notice and simply cleaner. 2) No A: Ok.. 3) It's going against the usual casting standard of (type) A: True The decision probably has been made already and if so just let me know and I'll stop trying to rise a voice for the community :P And no, I do not have a patch ;-) > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com > > -- David Coallier, Founder & Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.internals (#31127) next »