Re: Scary note for gettype() in docs

From: Date: Tue, 02 Mar 2010 08:22:44 +0000
Subject: Re: Scary note for gettype() in docs
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-47081@lists.php.net to get a copy of this message
On 03/01/2010 11:35 PM, Stan Vassilev wrote:
Hi, The gettype() documentation warns people that the returned string is "subject to change". Why is there a function that's subject to change in the API?
Because life is complicated. Because gettype("test") returns "string" in 5.x and "unicode" in 6.0. What exactly are you trying to fix? And what exactly are you proposing?
If I have to propose anything, that'd be for 6.0 unicode strings to return "string" and binary strings to return "binary", as that is more apt for the real-world use cases people will find themselves in (and migrating code will be easier). A PHP user stumbled onto the "subject to change" note and asked if it's safe to use. If differentiating both types of strings in 6.0 is what was intended, then it's perfectly safe to use, and I'll probably file an issue with docs to be more clear about the actual situation. Regards, Stan Vassilev

« previous php.internals (#47081) next »