booleans casted to strings
What happens when a false value is casted to a string?
I.e. what is the result of the following:
< ?php
var_dump((string)false);
?>
The answer is:
string(0) ""
This is good to know and expect when using some string functions that sometimes return a string and sometimes a boolean. Such functions are strstr(), strpos(), etc.
This entry was posted on Tuesday, March 15th, 2005 and is filed under PHP certification. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Get notification for future posts: follow me on Twitter or subscribe to my RSS feed
