note 89876 modified in overload.examples.basic by danbrown
| From: | danbrown@php.net | Date: | Thu, 26 Mar 2009 19:54:31 +0000 |
| Subject: | note 89876 modified in overload.examples.basic by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152493@lists.php.net to get a copy of this message | ||
You can't redeclare because PHP won't know which one to use. Use a default value and test
conditionally instead such as
<?php
public function method($arg=false){
if($arg==false){
//do something
} else {
//do something else
}
}
?>
--was--
You can't redeclare because PHP won't know which one to use. Use a default value and test
conditionally instead such as
public function method($arg=false){
if($arg==false){
//do something
} else {
//do something else
}
}
http://php.net/manual/en/overload.examples.basic.php