<?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[]= $d;
$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.24, 5.4.0 - 5.4.15
- Parse error: syntax error, unexpected ')', expecting ';' in FD1ma on line 6
Process exited with code 255. - Output for 5.3.25
- Parse error: syntax error, unexpected ')', expecting ';' in /in/GCnr7 on line 6
Process exited with code 255.
preferences:
175.59 ms | 1395 KiB | 49 Q