3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth']; $chose = [] $result = []; foreach($data as $i=>$item) { $pair = array_rand(array_diff_key($data, $chose)); $chose[] = $pair; $result[]= [$item, $data[$pair]]; } var_dump($result);
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected '$result' (T_VARIABLE) in /in/d6l9V on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/d6l9V on line 3
Process exited with code 255.