I don't understand why this get's a runtime limit exceeded, I've tried it for myself and it seems just fine...is it just too slow?
<?php
$fourtytwo = false;
while(!$fourtytwo)
{
$stdin = fopen('php://stdin', 'r');
$input = fgets($stdin,10000);
if($input == 42)
$fourtytwo = true;
else
echo $input;
fclose($stdin);
}
?>