3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $nos = array(800, 008, 080); function permutation($nos, $param = array( )) { if (empty($nos)) { print join(' ', $param) . "\n"; } else { for ($i = count($nos) - 1; $i >= 0; --$i) { $newnos = $nos; $newparam = $param; list($var) = array_splice($newnos, $i, 1); array_unshift($newparam, $var); permutation($newnos, $newparam); } } } print_r(permutation($nos));
Output for 7.0.0 - 7.0.1
Parse error: Invalid numeric literal in /in/ObvMY on line 3
Process exited with code 255.
Output for 5.3.21 - 5.6.28
800 0 0 0 800 0 800 0 0 0 800 0 0 0 800 0 0 800