Advent of code 2018/14
Ajax Direct

Answer

Part 1 :
Part 2 :
$scores = "37";
$a = 0; $b = 1;

$len = 2;
while (true) {
    $scores .= $scores[$a]  + $scores[$b];
    $a =  ($a + $scores[$a] + 1) % strlen($scores);
    $b =  ($b + $scores[$b] + 1) % strlen($scores);
    $len += strlen($scores[$a]  + $scores[$b]);

    if (substr($scores, -strlen($input)) == $input->string) {
        break;
    }
}

$solution_1 = substr($scores, $input->int, 10);
$solution_2 = strpos($scores, $input->string);