3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $re = '/([\D]+)|([\d]+)/'; $str = 'a74b8c0d3845e7'; preg_match_all($re, $str, $matches); print_r(array_combine(array_values(array_filter($matches[1],$matches[2]))));
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_filter() expects parameter 2 to be a valid callback, array must have exactly two members in /in/kOlT8 on line 6 Warning: array_values() expects parameter 1 to be array, null given in /in/kOlT8 on line 6 Warning: array_combine() expects exactly 2 parameters, 1 given in /in/kOlT8 on line 6
Output for hhvm-3.10.0 - 3.12.0
Warning: array_filter() expects parameter 2 to be a valid callback in /in/kOlT8 on line 6 Warning: array_values() expects parameter 1 to be an array or collection in /in/kOlT8 on line 6 Warning: array_combine() expects exactly 2 parameters, 1 given in /in/kOlT8 on line 6
Output for 5.2.3 - 5.2.17
Warning: array_filter(): The second argument, 'Array', should be a valid callback in /in/kOlT8 on line 6 Warning: array_values(): The argument should be an array in /in/kOlT8 on line 6 Warning: array_combine() expects exactly 2 parameters, 1 given in /in/kOlT8 on line 6
Output for 5.0.0 - 5.2.2
<br /> <b>Warning</b>: array_filter() [<a href='function.array-filter'>function.array-filter</a>]: The second argument, 'Array', should be a valid callback in <b>/in/kOlT8</b> on line <b>6</b><br /> <br /> <b>Warning</b>: array_values() [<a href='function.array-values'>function.array-values</a>]: The argument should be an array in <b>/in/kOlT8</b> on line <b>6</b><br /> <br /> <b>Warning</b>: array_combine() expects exactly 2 parameters, 1 given in <b>/in/kOlT8</b> on line <b>6</b><br />
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: array_combine() in <b>/in/kOlT8</b> on line <b>6</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: array_combine() in <b>/in/kOlT8</b> on line <b>6</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: array_combine() in <b>/in/kOlT8</b> on line <b>6</b><br />