3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $condition = ['one', 'two']; $key = key($condition); echo "The key is: " . $key . PHP_EOL; echo 'Without strict comparison:' . PHP_EOL; var_dump(in_array($key, ['a', 'b'])); echo 'With strict comparison:' . PHP_EOL; var_dump(in_array($key, ['a', 'b'], true)); echo 'Non-strict comparison of string to zero:' . PHP_EOL; var_dump(0 == 'a');
based on vB9e9
Output for 5.6.0 - 7.0.3, 7.0.5 - 7.2.6
The key is: 0 Without strict comparison: bool(true) With strict comparison: bool(false) Non-strict comparison of string to zero: bool(true)
Output for 7.0.4

Process exited with code 137.