Re: Re: blank function parameters

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

 



On 3 Nov 2004 16:38:39 -0000, Matthew Weier O'Phinney
<matthew@xxxxxxxxxx> wrote:
> * Daniel Schierbeck <dasch@xxxxxxxxxx>:
> 
> > function foobar ($a, $b, $c = null)
> > {
> >      if (isset($c)) {
> >          echo 'The third argument was set';
> >      }
> > }
> 
> That check should be for 'is_null($c)' as the default value of $c will
> be null, and it will be always set, even if not sent.
> 

The example above is correct ... you can check with isset($c) and
always will return false, as the manual says: " isset() will return
FALSE if testing a variable that has been set to NULL. "

Regards,
Jordi.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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