note 29460 rejected from function.overload by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 14 Feb 2003 08:52:13 +0000 |
| Subject: | note 29460 rejected from function.overload by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43918@lists.php.net to get a copy of this message | ||
I don't like the idea of calling overload (); function at all. That makes the code harder to
read and to maintain.
And why can I only overload methods (functions) defined in objects?
As this overloading thing is only in its developent stage why not make it something like this:
<?
overloaded function Test ()
{
echo 'Our first Test function taking no parameters';
}
overloaded function Test ($ourParameter)
{
echo 'Our second Test function taking one parameter set to: '.$ourParameter;
}
Test (); //would give output: Our first Test function taking no parameters
Test ('Hello'); //would give output: Our second Test function taking one parameter set
to: Hello
?>
Note: This is only an example of how to make it better and this code won't work with current
PHP version (4.3)!
From my point of view this way described the code is easier to read and there is no difference if
functions are members of a CLASS or if they are described elsewhere.