3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Example array $array = array( 'egg' => true, 'hair' => 765, 'goblins' => null, 'ogres' => 'no ogres allowed in this array' 'harry' => '' ); // 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 5.4.0 - 5.4.31
Parse error: syntax error, unexpected ''harry'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in /in/8pLiF on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /in/8pLiF on line 10
Process exited with code 255.