Scary note for gettype() in docs
| From: | Stan Vassilev | Date: | Mon, 01 Mar 2010 20:35:24 +0000 |
| Subject: | Scary note for gettype() in docs | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-47074@lists.php.net to get a copy of this message | ||
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?
And just to clarify: I agree is_*() is better if we test for a certain type (as the note says).
However, the use scenario for gettype() is when we do not test for a certain type (as in, we test
for any type), which is less optimal when executed as 5-6 is_*() calls.
Regards,
Stan Vassilev