Pierre wrote:
On Wed, 15 Mar 2006 12:26:53 -0800
[EMAIL PROTECTED] (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

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to