Re: is_string()

From: Date: Fri, 17 Mar 2006 22:01:19 +0000
Subject: Re: is_string()
References: 1 2 3 4  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-989@lists.php.net to get a copy of this message
Pierre wrote:
On Wed, 15 Mar 2006 12:26:53 -0800 andrei@gravitonic.com (Andrei Zmievski) wrote:
I guess I can live with this. It's just a little strange that we have only 2 string types, but 3 casts..
I find that confusing too. Given the commit log, it is even more confusing: - Updated is_string(): If Unicode semantics is turned on, return "true" for Unicode strings only. If Unicode semantics is turned off, return "true" for native strings only. It makes is_string basically useless, I can imagine two solutions: - keep it and always returns true (unicode and binary strings are strings anyway) - deprecate it in php 6.0, it will still returns true. At least people will know that they should use the new functions There is maybe a third solution, but certainly too drastic, remove is_string :) --Pierre
I think, to keep bc, it would be best to do as you say in point #1: is_string() returns true on unicode, native AND binary strings is_unicode() returns true only on unicode strings is_binary() returns true only on binary strings which would mean that string = unicode|binary. - tul

« previous php.i18n (#989) next »