note 86054 added to language.oop5.static

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
The example doesn't work (PHP 5.2.4).
"syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM"
here: print $foo::$my_static . "\n";
and here: print $classname::$my_static . "\n";
Please, check examples before adding to documentation.

<?php
class Foo
{
    public static $my_static = 'foo';

    public function staticValue() {
        return self::$my_static;
    }
}

class Bar extends Foo
{
    public function fooStatic() {
        return parent::$my_static;
    }
}

phpinfo();
print Foo::$my_static . "\n";

$foo = new Foo();
print $foo->staticValue() . "\n";
print $foo->my_static . "\n";      // Не определено свойство my_static 

print $foo::$my_static . "\n";
$classname = 'Foo';
print $classname::$my_static . "\n"; // Начиная только с PHP 5.3.0

print Bar::$my_static . "\n";
$bar = new Bar();
print $bar->fooStatic() . "\n";

?>
----
Server IP: 69.147.83.197
Probable Submitter: 194.44.10.106
----
Manual Page -- http://www.php.net/manual/en/language.oop5.static.php
Edit        -- https://master.php.net/note/edit/86054
Del: integrated  -- https://master.php.net/note/delete/86054/integrated
Del: useless     -- https://master.php.net/note/delete/86054/useless
Del: bad code    -- https://master.php.net/note/delete/86054/bad+code
Del: spam        -- https://master.php.net/note/delete/86054/spam
Del: non-english -- https://master.php.net/note/delete/86054/non-english
Del: in docs     -- https://master.php.net/note/delete/86054/in+docs
Del: other reasons-- https://master.php.net/note/delete/86054
Reject      -- https://master.php.net/note/reject/86054
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.