3v4l.org

run code in 300+ PHP versions simultaneously
<?php function search($input) { $result = $input; for($a=0,$a<count($input),$a++){ for($b=0,$b<count($input),$a++){ for($c=1,$c<b,$c++){ $d = $d . $input[$a+$c]; } $result []= $b; $d=""; } } return array_filter(array_unique($result)); } print json_encode(search(["a", "b"])) . "\n"; print json_encode(search(["a", "b", "c"]));
Output for 5.3.0 - 5.3.25, 5.4.0 - 5.4.15
Parse error: syntax error, unexpected ')', expecting ';' in /in/JYPMD on line 6
Process exited with code 255.

preferences:
171.77 ms | 1387 KiB | 49 Q