note 38492 added to function.overload
| From: | daveatetherealsysdotcom at rn2 dot php dot net | Date: | Wed, 24 Dec 2003 01:13:54 +0000 |
| Subject: | note 38492 added to function.overload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62395@lists.php.net to get a copy of this message | ||
This is not like the method overloading in Java. To accomplish this, you can try the following:
function javaLikeOverload($a = NULL, $b = NULL){
if($a && $b){
....
}
else if ($a){
....
}
else{
...
}
}
likewise, you can check if values are array, int, string, object, etc. or a combination of both.
----
Manual Page -- http://www.php.net/manual/en/function.overload.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38492
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38492&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38492&report=yes
Search -- http://master.php.net/manage/user-notes.php