The maximum value returned by getrandmax() is valid only if you call the rand() function without any parameter.
would still work because you have specified the limits even though getrandmax() returned 32767.
(PHP 4, PHP 5)
getrandmax — Show largest possible random value
Returns the maximum value that can be returned by a call to rand().
The largest possible random value returned by rand()