3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $categories = array( array('name' => 'ImportOrders', 'keywords' => array('ImportOrders', 'CountriesArrayResponse')) ); $matches = array(); $types = array('Keks', 'Import'); 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 1Dlos
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/Ze45K on line 11 Warning: array_push() expects at least 2 parameters, 1 given in /in/Ze45K on line 11 Notice: Only variables should be passed by reference in /in/Ze45K on line 11 Warning: array_push() expects at least 2 parameters, 1 given in /in/Ze45K on line 11
Output for 5.3.19 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/Ze45K on line 11 Warning: array_push() expects at least 2 parameters, 1 given in /in/Ze45K on line 11 Strict Standards: Only variables should be passed by reference in /in/Ze45K on line 11 Warning: array_push() expects at least 2 parameters, 1 given in /in/Ze45K on line 11