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) && isset($match[0]) && 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 - 7.1.0
Warning: Invalid argument supplied for foreach() in /in/LOcCu on line 5 Notice: Array to string conversion in /in/LOcCu 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/LOcCu on line 5 Array
Output for 4.3.11
Array