3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $product = array( array("id"=>1,"parentId"=>0,"stock"=>10), array("id"=>2,"parentId"=>1,"stock"=>11), array("id"=>3,"parentId"=>1,"stock"=>12), array("id"=>4,"parentId"=>0,"stock"=>13) ); $id = array(); $id[] = $item['id']; $parentId = array(); $parentId[] = $item['parentId']; print_r(array_intersect($id,$parentId));
based on erfhs
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: item in /in/vjAAt on line 9 Notice: Undefined variable: item in /in/vjAAt on line 11 Array ( [0] => )
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: item in /in/vjAAt on line 9 Notice: Undefined variable: item in /in/vjAAt on line 11 Array ( [0] => )