|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-20 23:38 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 13:00:01 2025 UTC |
Description: ------------ When comparing number zero with a not empty string, it returns true. Reproduce code: --------------- <?php $something = 0; if($something) { echo $something . "is true. <br />"; } if ("thestring") { echo "thestring is true" . "<br />"; } if ($something == "thestring") { echo "why?" . "<br />"; } if("thestring" == $something) { echo "again why?" . "<br />"; } ?> Expected result: ---------------- thestring is true Actual result: -------------- thestring is true why? again why?