diff --git a/language/operators.xml b/language/operators.xml index 660fb677aa..5dad563dba 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -1,5 +1,5 @@ - + Operators @@ -461,6 +461,32 @@ echo "hallo" ^ "hello"; // Outputs the ascii values #0 #4 #0 #0 #0 + + If you compare integer with the string, the string is + converted to number. + If you compare two numerical strings, they are compared as integers. These + rules are valid also for the + switch statement. + + + true +var_dump("1" == "01"); // 1 == 1 -> true + +switch ("a") { +case 0: + echo "0"; + break; +case "a": // never reached because "a" is already matched with 0 + echo "a"; + break; +} +?> +]]> + + + Another conditional operator is the "?:" (or ternary) operator.