You are missing the return
on your recursive calls:
return test($T01);
and
return test($T02);
In addition, you seem to have strange placement of braces on your else
clause. Most likely it should be:
else {
$result = array($T01,$T02);
return $result;
}
Finally, it's worth noting that this function will (theoretically) cause your code to recurse indefinitely, as you're just dividing a positive number in 2 all the time until it reaches 0. In theory this never happens. In practice, you'll recurse to some very-very small number at which the difference with 0 will be below the floating point precision. In my test this number was 4.9406564584125E-324
(i.e. about 0.0....0494 with ... being 322 zeros).