From fec07db19f8da7571649f0e8b9292abe6ce626a0 Mon Sep 17 00:00:00 2001 From: Richard Quadling Date: Wed, 13 Jan 2010 16:12:39 +0000 Subject: [PATCH] Better fix for #50738 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@293507 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/operators.xml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/language/operators.xml b/language/operators.xml index 94a1bdc6be..d37afe81f5 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -1096,19 +1096,21 @@ Expression: 0 = -4 << 62 - If you compare an integer with a string, excluding the identical (===) and - not identical (!==) operators, the string is - converted to a number. - If you compare two numerical strings, they are compared as integers. These - rules also apply to the - switch statement. + If you compare a number with a string or the comparison involves numerical + strings,then each string is + converted to a number + and the comparison performed numerically. These rules also apply to the + switch statement. The + type conversion does not take place when the comparison is === or !== as + this involves comparing the type as well as the value. true var_dump("1" == "01"); // 1 == 1 -> true -var_dump("1" == "1e0"); // 1 == 1 -> true +var_dump("10" == "1e1"); // 10 == 10 -> true +var_dump(100 == "1e2"); // 100 == 100 -> true switch ("a") { case 0: