|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-16 11:08 UTC] jakobsg at gmail dot com
Description: ------------ This is pretty straight forward. The soft evaluation (==) feature in php can be nice, personally I never use it, but I acknowledge that it can be useful in some situations. The result of the following evaluation however is not acceptable by any means (even in soft evaluation): 0 == '0' (true, and acceptable) 0 == 'o' (true, really!!!) 0 == 'o' are equal ... Common - this can only lead to errors. Best regards Jakob Simon-Gaarde Reproduce code: --------------- var_export(0=='o'); Expected result: ---------------- false Actual result: -------------- true PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 19:00:02 2025 UTC |
OK, I think you missed the point. It's not the stringified zero ("0") I'm talking about, it's the letter "o" that evaluates true when compared with zero. The letter "o" is no where en the O-2 table. Sorry if we have been talking about apples and bananas :-)