3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Example array $array = array( 'test' => 'test' ); // Loose checking var_dump(in_array(null, $array)); var_dump(in_array(false, $array)); var_dump(in_array(765, $array)); var_dump(in_array(763, $array)); var_dump(in_array('egg', $array)); var_dump(in_array('hhh', $array)); var_dump(in_array(array(), $array)); // Strict checking echo "now with strict\n"; var_dump(in_array(null, $array, true)); var_dump(in_array(false, $array, true)); var_dump(in_array(765, $array, true)); var_dump(in_array(763, $array, true)); var_dump(in_array('egg', $array, true)); var_dump(in_array('hhh', $array, true)); var_dump(in_array(array(), $array, true)); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) now with strict bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false)