3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $newarray = array('489289', '536516', '332833', '536516'); $rockin = array( '489289' => array('536516','332833'), '332833' => array('536516'), ); foreach ($rockin as $array) { foreach ($array as $value) { if (in_array($value, $newarray)) { $key = array_search($array, $rockin); $newarray = array_diff($newarray, array($key)); } } } var_dump($newarray);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(2) { [1]=> string(6) "536516" [3]=> string(6) "536516" }
Output for hhvm-3.10.0

Process exited with code 153.