|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-10-18 19:18 UTC] rasmus@php.net
-Status: Open
+Status: Bogus
[2010-10-18 19:18 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Feb 08 20:00:01 2026 UTC |
Description: ------------ I'd like to propose a change in converting booleans to string. It'd be better if (string) FALSE returns '0' instead of empty string (''). Why to do so? a) More logical behavior. b) Using booleans in output would be meaningful. c) Backward-compatible change - as documentation says: "This allows conversion back and forth between boolean and string values." - this behavior is not changed by this, because (bool) '0' is FALSE. Test script: --------------- <?php echo (string) FALSE; //nothing now, '0' requested var_dump((bool) '0'); //FALSE, no change var_dump((string) FALSE === '0'); //FALSE, TRUE requested