3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array1 = array('description' => 'desc bla bla bla', 'summary' => 'summary bla bla bla', 'usage' => 'usage bla bla bla', 'status' => false); $array2 = array('description', 'summary'); $array_intersected = array_flip(array_intersect(array_flip($array1), $array2)); var_dump($array_intersected);
based on A6d7g
Output for 4.3.2 - 7.2.0
Warning: array_flip(): Can only flip STRING and INTEGER values! in /in/ggMoY on line 5 array(2) { ["description"]=> string(16) "desc bla bla bla" ["summary"]=> string(19) "summary bla bla bla" }
Output for 4.3.0 - 4.3.1
Warning: array_flip() [http://www.php.net/function.array-flip]: Can only flip STRING and INTEGER values! in /in/ggMoY on line 5 array(2) { ["description"]=> string(16) "desc bla bla bla" ["summary"]=> string(19) "summary bla bla bla" }