RE: [PHP3] Quick Question From: Dyas, Alex (alex.dyas <email protected>)
Date: 08/31/99

I'm not sure if you can legitimately overload functions, but this is one
'hack' to get round it if you can't:

<?
function foo($this)
{
        echo "Foo executed<br>";
        if(Isset($this))
        {
                echo "This:$this<br>";
        }
        else
        {
                echo "This is empty<br>";
        }
}

 <email protected>();
 <email protected>("bah");
?>

The @ will supress any warnings that come up when php notices missing
arguments, and Isset will determine if the argument(s) have been passed.

alex..

-= Alex Dyas - Web Developer - MCI WorldCom - UK =-

> -----Original Message-----
> From: Sam Turner [mailto:squirrley5 <email protected>]
> Sent: 31 August 1999 17:34
> To: php3 <email protected>
> Subject: [PHP3] Quick Question
>
>
> Is Function overloading available in PHP? I want to have two separate
> functions,
> function read_from_file(); and function read_from_file( $date_start ,
> $date_end ); ... is this possible?
>
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to
> php3-unsubscribe <email protected>
> To subscribe to the digest, e-mail:
> php3-digest-subscribe <email protected>
> To search the mailing list archive, go to:
> http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail:
> php-list-admin <email protected>
>
>
----------------------
CONFIDENTIALITY NOTICE
This communication contains information which is confidential and may also be
privileged. It is for the exclusive use of the intended recipient(s). If you
are not the intended recipient(s), please note that any distribution, copying
or use of this communication or the information in it is strictly prohibited.
If you have received this communication in error, please notify us immediately
by telephone on +44 171 675 5000 and then destroy the email and any copies of
it. This communication is from MCI WorldCom Limited whose registered office is
at 14 Gray's Inn Road, London WC1X 8HN. Registered number 2776038.

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>