|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-07-26 02:50 UTC] miss_shah00 at hotmail dot com
Description: ------------ PHP Manual at php.net, Language Reference->Classes and Objects->Static Keywords http://www.php.net/manual/en/language.oop5.static.php One of the statements in Example 1: Static Property Example print $foo::$my_static . "\n"; does not compile because an instantiated object of a class cannot access static property. Therefore this example has an error. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 09:00:02 2026 UTC |
$ php -r 'class Foo { public static $prop = "value"; } $o = new Foo; var_dump($o::$prop);' string(5) "value" Works fine for me...