Re: system() Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 28, 2008 at 6:49 PM, Daniel Brown <danbrown@xxxxxxx> wrote:

> On Sun, Dec 28, 2008 at 18:10, Rick Pasotto <rick@xxxxxxxx> wrote:
> >
> > You overlooked the ampersand in front of $retval. The syntax for
> > 'system' is:
> >
> > string system  ( string $command  [, int &$return_var  ] )
> >
> > You have to pass a pointer to the variable, not the variable itself.
>
>     Actually, that's not entirely correct.... while the documentation
> shows it as a reference variable, it's not actually required to be a
> pointer.


good point dan, and just to add further clarification, thats b/c the
function specifies $return_var is passed by reference in the formal
parameter.  when you include the & along w/ an actual parameter (during
function invocation) thats referred to as call-time-pass-by-reference in
php, and its typically frowned upon.  in fact, i think its being removed
from a future version of php.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux