3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'Bot draws - nino: (JH)'; preg_match("#^Bot draws - ([a-z0-9\-\._]+)\: ?(\((.*)\))?$#i",$str,$match); if ( is_array($match) && count($match[0]) > 0 ) { foreach($match[0] as $key=>$val) { $$match[1][$key] = create_function($match[2][$key],$match[3][$key]); } } echo $match;
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/qdlSE on line 4 Warning: Invalid argument supplied for foreach() in /in/qdlSE on line 5 Notice: Array to string conversion in /in/qdlSE on line 9 Array
Output for 5.4.0 - 7.1.10
Warning: Invalid argument supplied for foreach() in /in/qdlSE on line 5 Notice: Array to string conversion in /in/qdlSE on line 9 Array
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.3.29
Warning: Invalid argument supplied for foreach() in /in/qdlSE on line 5 Array
Output for 4.3.11
Array