mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Improve example (patch provided by Joel James)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@340241 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
da36163bfb
commit
bf5cfd002c
1 changed files with 2 additions and 1 deletions
|
@ -56,6 +56,7 @@ $obj->printHello(); // Shows Public, Protected and Private
|
|||
class MyClass2 extends MyClass
|
||||
{
|
||||
// We can redeclare the public and protected method, but not private
|
||||
public $public = 'Public2';
|
||||
protected $protected = 'Protected2';
|
||||
|
||||
function printHello()
|
||||
|
@ -70,7 +71,7 @@ $obj2 = new MyClass2();
|
|||
echo $obj2->public; // Works
|
||||
echo $obj2->protected; // Fatal Error
|
||||
echo $obj2->private; // Undefined
|
||||
$obj2->printHello(); // Shows Public, Protected2, Undefined
|
||||
$obj2->printHello(); // Shows Public2, Protected2, Undefined
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
|
Loading…
Reference in a new issue