Strings that look like numbers
Two strings compared with ==. Watch what happens when both look like numbers.
<?phpecho var_export("1" == "01", true) . PHP_EOL;echo var_export("10" == "1e1", true) . PHP_EOL;echo var_export("abc" == "ABC", true) . PHP_EOL;echo var_export("1" === "01", true) . PHP_EOL;1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…
- 3…
- 4…