note 104621 added to overload.examples.basic
| From: | Anonymous at osu1 dot php dot net | Date: | Sun, 26 Jun 2011 20:20:35 +0000 |
| Subject: | note 104621 added to overload.examples.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180970@lists.php.net to get a copy of this message | ||
The result for
<?php
class Foo{
public function method(){
echo "call Method no paramater";
}
public function method($par){
echo "call Method has a paramater";
}
}
$foo = new Foo();
echo $foo->method("param");]
?>
can be achieved by
<?php
class Foo{
public function method($par = null){
echo "call Method no paramater";
}
}
$foo = new Foo();
echo $foo->method("param");]
?>
Php will give access to both $foo->method() and $foo->method("param")
----
Server IP: 80.67.10.228
Probable Submitter: 213.64.18.84
----
Manual Page -- http://www.php.net/manual/en/overload.examples.basic.php
Edit -- https://master.php.net/note/edit/104621
Del: integrated -- https://master.php.net/note/delete/104621/integrated
Del: useless -- https://master.php.net/note/delete/104621/useless
Del: bad code -- https://master.php.net/note/delete/104621/bad+code
Del: spam -- https://master.php.net/note/delete/104621/spam
Del: non-english -- https://master.php.net/note/delete/104621/non-english
Del: in docs -- https://master.php.net/note/delete/104621/in+docs
Del: other reasons-- https://master.php.net/note/delete/104621
Reject -- https://master.php.net/note/reject/104621
Search -- https://master.php.net/manage/user-notes.php