Doc #52442 [Opn->Bgs]: Static Keyword in PHP manual: Example has a bug

From: Date: Mon, 26 Jul 2010 10:52:02 +0000
Subject: Doc #52442 [Opn->Bgs]: Static Keyword in PHP manual: Example has a bug
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4740@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52442&edit=1 ID: 52442 Updated by: bjori@php.net Reported by: miss_shah00 at hotmail dot com Summary: Static Keyword in PHP manual: Example has a bug -Status: Open +Status: Bogus Type: Documentation Problem Package: Website problem Operating System: Windows Vista Home Premium PHP Version: 5.2.14 Block user comment: N New Comment: $ php -r 'class Foo { public static $prop = "value"; } $o = new Foo; var_dump($o::$prop);' string(5) "value" Works fine for me... Previous Comments: ------------------------------------------------------------------------ [2010-07-26 02:50:37] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52442&edit=1

« previous php.doc.bugs (#4740) next »