3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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));
based on SvGbg
Output for 4.3.0 - 5.6.30, 7.0.0 - 7.3.0rc3
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)
Output for hhvm-3.10.1, hhvm-3.20.2 - 3.22.0
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(1) strcasecmp(d, a) int(-1)
Output for hhvm-3.11.1 - 3.19.2
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) NULL strcmp(d, a) NULL strcasecmp(a, b) int(-53) strcasecmp(a, c) int(-2) strcasecmp(a, d) NULL strcasecmp(d, a) NULL