Re: system() Question

From: Date: Mon, 29 Dec 2008 03:20:59 +0000
Subject: Re: system() Question
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-285174@lists.php.net to get a copy of this message
On Sun, Dec 28, 2008 at 6:49 PM, Daniel Brown <danbrown@php.net> wrote: > On Sun, Dec 28, 2008 at 18:10, Rick Pasotto <rick@niof.net> 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

« previous php.general (#285174) next »