function foo( $arg1, $arg2 = null )
{
    .. as before ..
}

--
Alan McFarlane

Rodent Of Unusual Size <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> An odd request..  I want to have optional function arguments
> that *aren't* defined unless values are explicitly passed.  Sorta
> the equivalent of
>
> function foo($arg1_required, $arg2_optional=undef)
>     if (isset($arg2_optional)) {
> print "explicit";
>     }
>     else {
> print "not passed";
>     }
> }
>
> Something like this is possible in Perl through the 'undef'
> construct; is anything like this available in PHP?
> --
> #ken P-)}
>
> Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
> Author, developer, opinionist      http://Apache-Server.Com/
>
> "Millennium hand and shrimp!"



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

Reply via email to