note 86159 added to language.oop5.visibility

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
PHP 5.2.3, windows

The comment in this example is invalid

<?php
/**
 * Define MyClass2
 */
class MyClass2 extends MyClass
{
    // We can redeclare the public and protected method, but not private
    protected $protected = 'Protected2';

    function printHello()
    {
        echo $this->public;
        echo $this->protected;
        echo $this->private;
    }
}
?>

Just try this:

<?php

class MyClass2 extends MyClass
{
    // We CAN redeclare the public, protected and private PROPERTIES in this example
    public $public = 'Public2';
    protected $protected = 'Protected2';
    private $private = 'Private2';

    function printHello()
    {
        echo $this->public;
        echo $this->protected;
        echo $this->private;
    }
}

?>
----
Server IP: 91.196.196.241
Probable Submitter: 212.15.152.123
----
Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php
Edit        -- https://master.php.net/note/edit/86159
Del: integrated  -- https://master.php.net/note/delete/86159/integrated
Del: useless     -- https://master.php.net/note/delete/86159/useless
Del: bad code    -- https://master.php.net/note/delete/86159/bad+code
Del: spam        -- https://master.php.net/note/delete/86159/spam
Del: non-english -- https://master.php.net/note/delete/86159/non-english
Del: in docs     -- https://master.php.net/note/delete/86159/in+docs
Del: other reasons-- https://master.php.net/note/delete/86159
Reject      -- https://master.php.net/note/reject/86159
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.