note 109225 deleted from overload.examples.basic by danbrown
| From: | danbrown@php.net | Date: | Wed, 27 Jun 2012 16:34:29 +0000 |
| Subject: | note 109225 deleted from overload.examples.basic by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188919@lists.php.net to get a copy of this message | ||
Note Submitter: Tas
----
RE: Anonymous 26-Jun-2011 01:20
I think you mean:
class Foo{
public function method_noargs(){
echo "call Method no paramater";
}
public function method(){
if ( !count(func_get_args()) )
return $this->method_noargs(); //or in same method, doesnt matter
echo "call Method has paramater";
}
}
$foo = new Foo();
echo $foo->method();
Which (a) actually achieves the result and (b) will work even when you pass 0, false or null.