Correct way to submit a PHP code

I am trying to get acquainted with the procedures here and hence tried to submit the solution for a practice problem. But, it always returns as wrong answer. I also tried to submit an already selected answer (written in PAS fpc) as my answer (written in PHP), but it still didn’t work. Any insight ? Is my conversion not proper or there is some other way to submit a PHP code ?

My submission:

$stdin = fopen("php://stdin", "r");
$input = fgets($stdin);
$a = explode(' ',$input);
if($a[1]>=($a[0]+0.5) && ($a[0]%5)==0)
  echo number_format((float)($a[1]-$a[0]-0.5),2,'.',''); 
  echo number_format((float)$a[1], 2, '.', '')."\n";

The answer that I copied from:

Found a similar question at Atempting to use STDIN instead of reading stream.