Re: can i rely on ctype?
| From: | Stefan Walk | Date: | Sun, 15 Jul 2007 21:36:45 +0000 |
| Subject: | Re: can i rely on ctype? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47503@lists.php.net to get a copy of this message | ||
On 15/07/07, Alexey Borzov <borz_off@cs.msu.su> wrote:
That's a bit strange, since deprecating the extension that is currently enabled by default is a pretty major change. I think getting the relevant info out of Marcus and / or Andrei is in order...A pretty major change that makes perfect sense. When PHP6 is there, there are char_is_*-functions using ICU (the unicode library). Those functions do everything that ctype does in a more coherent way, example: swalk@itchy:~/programming/php/php6> ./php-unicode -r 'var_dump(ctype_digit(123));' bool(false) swalk@itchy:~/programming/php/php6> ./php-unicode -r 'var_dump(char_is_digit(123));' bool(true) So you don't have to explicitely cast to string anymore when you want to check that a value you got is either an integer or a string containing only an integer, which is more like string/int juggling works in the rest of php ... to summarize, you have new functions offering the same functionality and more, and have a cleaner API ... so the rational thing to do is deprecate the old functionality. It won't be gone, but folks should be made aware that better things are available. Regards, Stefan