Not sure but this code is returning incorrect values for freaking f mod

PHP Code:
++$blah;
$r fmod($blah3); 
First iteration of the loop that this code is in returns null, second returns 1 third returns 2 fourth returns 0.

++blah is a counter var in the loop and initially is set to 0 before the loop.

First iteration should be 1 then 2 then 3 then back to 1

Why doesnt stupid php have a standard mod operator?