3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo 'within var_dump: '; var_dump('0012e2' == '1e3'); $a = '0012e2'; $b = '1e3'; var_dump($a); var_dump($b); echo '== :'."\n"; echo 'direct : '; $i = ($a == $b); var_dump($i); echo 'direct strings : '; $i = ((string) $a == (string) $b); var_dump($i); echo 'string in var_dump: '; var_dump((string) $a == (string) $b); echo 'within var_dump: '; var_dump($a == $b); echo '=== :'."\n"; $i = (bool)((string) $a === (string) $b); var_dump($i); var_dump((string) '0010e2' === (string) '1e3'); echo '-'."\n";
based on 3QsG0
Output for 4.3.0 - 7.2.0
within var_dump: bool(false) string(6) "0012e2" string(3) "1e3" == : direct : bool(false) direct strings : bool(false) string in var_dump: bool(false) within var_dump: bool(false) === : bool(false) bool(false) -