3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $selected=array('11a_Ma1','11a_Sc2','11b_Ls1'); $already=array('11SJP','11a_Ma1','11a_Sc2'); print_r(array_diff($selected,$already)); print_r(array_diff($already,$selected)); $a1=array(1,2,3); $a2=array(1,2,3); $ad=array_diff($a1,$a2); if(isset($ad)){echo "YEAH";} if(empty($ad)){echo "empty... bitch";}
Output for 4.3.0 - 7.1.0
Array ( [2] => 11b_Ls1 ) Array ( [0] => 11SJP ) YEAHempty... bitch