dotjoon — 2010-12-05T19:28:25-05:00 — #1
int rand ( void )
The quote above is from the manual.
What does void mean?
guido2004 — 2010-12-05T19:31:26-05:00 — #2
In this case I guess it means empty, non existing. In other words, rand(), without giving it the two parameters.
logic_earth — 2010-12-05T19:32:37-05:00 — #3
void as a return type means that the return value is useless. void in a parameter list means that the function doesn't accept any parameters.
raffles — 2010-12-05T19:34:46-05:00 — #4
A void in English is an empty space, so it means the function doesn't accept any arguments. If you pass it any arguments, it will produce an error.
You will also see things like this:
void echo ( string $arg1 [, string $...] )
That means the function doesn't return anything.
I guess we pretty much fully covered it.
system — 2010-12-05T19:51:32-05:00 — #5
in the context of the manual
If called without the optional min, max arguments rand() returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 5 and 15 (inclusive), for example, use rand(5, 15).
it means that passing input parameters to the function is optional
if in your code you have
$randNum = rand();
$randNum will have a value between 0 and getrandmax