3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "1.0e6"; $b = "1.e6"; $c = 1000000; $d = null; echo 'a == b '; var_dump($a == $b); echo 'a == c '; var_dump($a == $c); echo 'a == d '; var_dump($a == $d); echo "\n"; echo 'a === b '; var_dump($a === $b); echo 'a === c '; var_dump($a === $c); echo 'a === d '; var_dump($a === $d); echo "\n"; echo 'strcmp(a, b) '; var_dump(@strcmp($a, $b)); echo 'strcmp(a, c) '; var_dump(@strcmp($a, $c)); echo 'strcmp(a, d) '; var_dump(@strcmp($a, $d)); echo 'strcmp(d, a) '; var_dump(@strcmp($d, $a)); echo "\n"; echo 'strcasecmp(a, b) '; var_dump(@strcasecmp($a, $b)); echo 'strcasecmp(a, c) '; var_dump(@strcasecmp($a, $c)); echo 'strcasecmp(a, d) '; var_dump(@strcasecmp($a, $d)); echo 'strcasecmp(d, a) '; var_dump(@strcasecmp($d, $a));
Output for 7.3.29 - 7.3.33, 7.4.20, 7.4.22 - 7.4.30, 8.0.1, 8.0.5 - 8.0.7, 8.0.9 - 8.0.22, 8.1.0 - 8.1.9
a == b bool(true) a == c bool(true) a == d bool(false) a === b bool(false) a === c bool(false) a === d bool(false) strcmp(a, b) int(-1) strcmp(a, c) int(-1) strcmp(a, d) int(5) strcmp(d, a) int(-5) strcasecmp(a, b) int(-53) strcasecmp(a, c) int(-2) strcasecmp(a, d) int(5) strcasecmp(d, a) int(-5)
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 7.4.21, 8.0.0, 8.0.2 - 8.0.3, 8.0.8
a == b bool(true) a == c bool(true) a == d bool(false) a === b bool(false) a === c bool(false) a === d bool(false) strcmp(a, b) int(-53) strcmp(a, c) int(-512) strcmp(a, d) int(5) strcmp(d, a) int(-5) strcasecmp(a, b) int(-53) strcasecmp(a, c) int(-2) strcasecmp(a, d) int(5) strcasecmp(d, a) int(-5)

preferences:
36.8 ms | 415 KiB | 5 Q