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 = str_split($explosion[0]); $upper = str_split($explosion[1]); $arr = array(); $curr = $lower; while ($curr != $upper) { if (is_numeric($curr[ $arr[] = implode('',$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); } } } } $arr[] = implode('',$curr); return $arr; } print_r(arrFromString('0E-1F'));
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.5.3
Parse error: syntax error, unexpected ';', expecting ']' in /in/MTLsN on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ';', expecting ']' in /in/MTLsN on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `']'' in /in/MTLsN on line 15
Process exited with code 255.