3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $chanstring = "\x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B / %x2D-39 / %x3B-FF"; function arrFromString($string) { $explosion = explode($string,'-'); $lower = split($explosion[0]); $upper = split($explosion[1]); $arr = array(); $curr = $lower; while ($curr != $upper) { $arr[] = $curr; if (is_numeric($curr[1])) { $curr[1]++; if ($curr[1] > 9) { $curr[1] = 'A'; } } else { $curr[1] = chr(ord($curr[1]) + 1); if ($curr[1] === 'E') { $curr[1] = 0; if (is_numeric($curr[0])) { $curr[0]++; if ($curr[0] > 9) { $curr[0] = 'A'; } } else { $curr[1] = chr(ord($curr[1]) + 1); } } } } return $arr; } print_r(arrFromString('01-07'));
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function split() in /in/L36PA:8 Stack trace: #0 /in/L36PA(39): arrFromString('01-07') #1 {main} thrown in /in/L36PA on line 8
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: split() expects at least 2 parameters, 1 given in /in/L36PA on line 8 Notice: Undefined index: 1 in /in/L36PA on line 9 Warning: split() expects at least 2 parameters, 1 given in /in/L36PA on line 9 Array ( )
Output for 5.5.0 - 5.6.28
Deprecated: Function split() is deprecated in /in/L36PA on line 8 Warning: split() expects at least 2 parameters, 1 given in /in/L36PA on line 8 Notice: Undefined offset: 1 in /in/L36PA on line 9 Deprecated: Function split() is deprecated in /in/L36PA on line 9 Warning: split() expects at least 2 parameters, 1 given in /in/L36PA on line 9 Array ( )
Output for 5.3.0 - 5.4.45
Warning: split() expects at least 2 parameters, 1 given in /in/L36PA on line 8 Warning: split() expects at least 2 parameters, 1 given in /in/L36PA on line 9 Array ( )
Output for 5.2.3 - 5.2.17
Warning: Wrong parameter count for split() in /in/L36PA on line 8 Warning: Wrong parameter count for split() in /in/L36PA on line 9 Array ( )
Output for 4.3.0 - 5.2.2
<br /> <b>Warning</b>: Wrong parameter count for split() in <b>/in/L36PA</b> on line <b>8</b><br /> <br /> <b>Warning</b>: Wrong parameter count for split() in <b>/in/L36PA</b> on line <b>9</b><br /> Array ( )