|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-01-25 14:11 UTC] james dot laver at gmail dot com
Description: ------------ (1 == 'foo') returns boolean true The documentation claims otherwise (see http://www.php.net/manual/en/types.comparisons.php) Logically this cannot be true, and it should not be necessary to use === to perform this. Reproduce code: --------------- echo "value: " . (true == 'foo'); Expected result: ---------------- "value: 0" Actual result: -------------- "value: 1" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
Sorry, i hit submit before I was finished and then I was wrong anyway. Human error. <?php echo "php == true ". (('php'==true)?'true':'false') . "\n"; echo "1 == php " . (('php'==1)?'true':'false'); ?> php == true true 1 == php false Closing as bogus, sorry about that