3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $categories = array( array('name' => 'ImportOrders', 'keywords' => array('ImportOrders', 'CountriesArrayResponse')) ); $matches = array(); foreach($categories as $cat) { foreach($cat['keywords'] as $keyword) { $array_filter = function($var) use ($keyword) { return preg_match("/\b$keyword\b/i", $var); }; $matches[$cat['name']] = array_push(array_filter($types, $array_filter)); } }
based on iRGZP
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: types in /in/6k1pJ on line 10 Warning: array_filter() expects parameter 1 to be array, null given in /in/6k1pJ on line 10 Notice: Only variables should be passed by reference in /in/6k1pJ on line 10 Warning: array_push() expects at least 2 parameters, 1 given in /in/6k1pJ on line 10 Notice: Undefined variable: types in /in/6k1pJ on line 10 Warning: array_filter() expects parameter 1 to be array, null given in /in/6k1pJ on line 10 Notice: Only variables should be passed by reference in /in/6k1pJ on line 10 Warning: array_push() expects at least 2 parameters, 1 given in /in/6k1pJ on line 10
Output for 5.3.19 - 5.6.28
Notice: Undefined variable: types in /in/6k1pJ on line 10 Warning: array_filter() expects parameter 1 to be array, null given in /in/6k1pJ on line 10 Strict Standards: Only variables should be passed by reference in /in/6k1pJ on line 10 Warning: array_push() expects at least 2 parameters, 1 given in /in/6k1pJ on line 10 Notice: Undefined variable: types in /in/6k1pJ on line 10 Warning: array_filter() expects parameter 1 to be array, null given in /in/6k1pJ on line 10 Strict Standards: Only variables should be passed by reference in /in/6k1pJ on line 10 Warning: array_push() expects at least 2 parameters, 1 given in /in/6k1pJ on line 10