3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $items = range('a', 'g'); function permute($items, $perms = array( )) { if (empty($items)) { print '<pre>'; print_r($perms); } else { for ($i = count($items) - 1; $i >= 0; --$i) { $newitems = $items; $newperms = $perms; list($foo) = array_splice($newitems, $i, 1); array_unshift($newperms, $foo); permute($newitems, $newperms); } } } permute($items);

Abusive script

This script was stopped while abusing our resources