3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = 'abc'; $file = ['abc', 'cba', 'bac', 'dac', 'ebcda']; $sortedInput = sort(explode('', $input)); foreach ($file as $item) { $sortedItem = explode('', $item) if ($sortedItem == $sortedInput) { echo "$item\n"; } }
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'if' (T_IF) in /in/Qnkrl on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/Qnkrl on line 4
Process exited with code 255.