3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array("te","yes","we","no","1","sdfsdf","Resolved"); $array2 = array("another","no","we","no","0","sdfsdf","Unresolved"); foreach($array2 as $k=>$v){ if(!in_array($v,$array1[$k] )){ echo "Value $v exists \n"; }else{ echo "Value $v does not exists \n"; } }
based on 2p9Zc
Output for 5.3.0 - 7.1.0
Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value another exists Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value no exists Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value we exists Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value no exists Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value 0 exists Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value sdfsdf exists Warning: in_array() expects parameter 2 to be array, string given in /in/tknJF on line 7 Value Unresolved exists
Output for 4.3.2 - 5.2.17
Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value another exists Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value no exists Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value we exists Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value no exists Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value 0 exists Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value sdfsdf exists Warning: in_array(): Wrong datatype for second argument in /in/tknJF on line 7 Value Unresolved exists
Output for 4.3.0 - 4.3.1
Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value another exists Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value no exists Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value we exists Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value no exists Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value 0 exists Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value sdfsdf exists Warning: in_array() [http://www.php.net/function.in-array]: Wrong datatype for second argument in /in/tknJF on line 7 Value Unresolved exists