3v4l.org

run code in 300+ PHP versions simultaneously
<?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)); } }
Output for 7.3.16 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Notice: Only variables should be passed by reference in /in/Ze45K on line 11 Notice: Only variables should be passed by reference in /in/Ze45K on line 11
Output for 7.3.32 - 7.3.33
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
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.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 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

preferences:
175.22 ms | 403 KiB | 231 Q