3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fnames = array("Patrick","Janjan","Nico"); $mnames = array("Dasal","Agustino","Macatangay"); $lnames = array("Paredes","Fung","Acedillo"); $names = array($fnames,$mnames,$lnames); var_dump(array_intersect($names, [["Patrick"]])); if(array_intersect($names, [["Patrick"]])){ echo "It exists"; } else{ echo "Doesn't exists"; }
based on NI35R
Output for 5.6.30, 7.0.30 - 7.3.0alpha1
Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 array(3) { [0]=> array(3) { [0]=> string(7) "Patrick" [1]=> string(6) "Janjan" [2]=> string(4) "Nico" } [1]=> array(3) { [0]=> string(5) "Dasal" [1]=> string(8) "Agustino" [2]=> string(10) "Macatangay" } [2]=> array(3) { [0]=> string(7) "Paredes" [1]=> string(4) "Fung" [2]=> string(8) "Acedillo" } } Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 It exists
Output for hhvm-3.22.0
Notice: Array to string conversion in /in/49iKl on line -1 Notice: Array to string conversion in /in/49iKl on line -1 Notice: Array to string conversion in /in/49iKl on line -1 Notice: Array to string conversion in /in/49iKl on line -1 array(3) { [0]=> array(3) { [0]=> string(7) "Patrick" [1]=> string(6) "Janjan" [2]=> string(4) "Nico" } [1]=> array(3) { [0]=> string(5) "Dasal" [1]=> string(8) "Agustino" [2]=> string(10) "Macatangay" } [2]=> array(3) { [0]=> string(7) "Paredes" [1]=> string(4) "Fung" [2]=> string(8) "Acedillo" } } Notice: Array to string conversion in /in/49iKl on line -1 Notice: Array to string conversion in /in/49iKl on line -1 Notice: Array to string conversion in /in/49iKl on line -1 Notice: Array to string conversion in /in/49iKl on line -1 It exists
Output for hhvm-3.18.5 - 3.21.3
Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 Notice: Array to string conversion in /in/49iKl on line 8 array(3) { [0]=> array(3) { [0]=> string(7) "Patrick" [1]=> string(6) "Janjan" [2]=> string(4) "Nico" } [1]=> array(3) { [0]=> string(5) "Dasal" [1]=> string(8) "Agustino" [2]=> string(10) "Macatangay" } [2]=> array(3) { [0]=> string(7) "Paredes" [1]=> string(4) "Fung" [2]=> string(8) "Acedillo" } } Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 Notice: Array to string conversion in /in/49iKl on line 9 It exists