3v4l.org

run code in 150+ 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 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
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 hhvm-3.12.0
Warning: Invalid argument supplied for foreach() in /in/qdlSE on line 7 Notice: Array to string conversion in /in/qdlSE on line 9 Array
Output for hhvm-3.10.0

Process exited with code 153.
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