Reputation: 2184
For example when I look at the documentation for system function: it says:
string system ( string $command [, int &$return_var ] )
What does this mean? thanks
Upvotes: 1
Views: 82
Reputation: 656
So for the parts of:
string system ( string $command [ , int & $return_var ] )
1 2 3 4 5 6 7 8 9 10 11 12
in order:
It is hinting as to what might be required to call the function. So syntactically, the following are OK:
$return_type = 1;
system("String!", $return_type);
//$return_type could have changed
system("String!", $return_type);
system("String!");
But the following are not:
system();
system($var_that_wont_cast_to_string);
** PHP docs on pass by reference: http://php.net/manual/en/language.references.pass.php
Upvotes: 1
Reputation: 3093
See here for the description given within php.net itself:
http://php.net/manual/en/about.prototypes.php
Upvotes: 1
Reputation: 424
The listing of string
or int
are telling you what types of value it expects. It expects system
to be of type string
, an so on. If you put an int
for system
, you will get an error
Upvotes: -2
Reputation: 939
Means that the function name is system(), and those are the parameters and types of this function.
in this case, string $command is mandatory (and you need to pass an valid String value). When you have brackets, like in (&$return_var) is an optional parameter (& means the variable will be passed as reference, so the return value will be on the variable you pass to the function).
Upvotes: 1