3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $langs = array('en', 'de', 'pt', 'pl', 'it'); $arr = array(); foreach($langs as $key => $lang){ $arr[$lang] = $langs; unset($arr[$lang][$key]); sort($arr[$lang]); } print_r($arr);
Output for 4.3.0 - 7.2.0
Array ( [en] => Array ( [0] => de [1] => it [2] => pl [3] => pt ) [de] => Array ( [0] => en [1] => it [2] => pl [3] => pt ) [pt] => Array ( [0] => de [1] => en [2] => it [3] => pl ) [pl] => Array ( [0] => de [1] => en [2] => it [3] => pt ) [it] => Array ( [0] => de [1] => en [2] => pl [3] => pt ) )