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 5.4.0 - 5.4.45, 5.5.24 - 5.5.30, 5.6.7 - 5.6.14
Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /in/1Dlos on line 8
Process exited with code 255.

preferences:
184.23 ms | 1395 KiB | 67 Q