mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Overloading methods must be public (bug #31806)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@185287 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3d55b0e7c1
commit
e339dcb923
1 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<sect1 id="language.oop5.overloading">
|
||||
<title>Overloading</title>
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
|||
__call, __get and __set methods. These methods will only be
|
||||
triggered when your object or inherited object doesn't contain the
|
||||
member or method you're trying to access.
|
||||
All overloading methods must be defined as
|
||||
<link linkend="language.oop5.visibility">public</link>.
|
||||
</para>
|
||||
|
||||
<sect2 id="language.oop5.overloading.members">
|
||||
|
@ -41,7 +43,7 @@ class Setter
|
|||
public $n;
|
||||
private $x = array("a" => 1, "b" => 2, "c" => 3);
|
||||
|
||||
function __get($nm)
|
||||
public function __get($nm)
|
||||
{
|
||||
print "Getting [$nm]\n";
|
||||
|
||||
|
@ -54,7 +56,7 @@ class Setter
|
|||
}
|
||||
}
|
||||
|
||||
function __set($nm, $val)
|
||||
public function __set($nm, $val)
|
||||
{
|
||||
print "Setting [$nm] to $val\n";
|
||||
|
||||
|
@ -136,7 +138,7 @@ class Caller
|
|||
{
|
||||
private $x = array(1, 2, 3);
|
||||
|
||||
function __call($m, $a)
|
||||
public function __call($m, $a)
|
||||
{
|
||||
print "Method $m called:\n";
|
||||
var_dump($a);
|
||||
|
|
Loading…
Reference in a new issue