|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-05-27 19:45 UTC] fleshgrinder at gmx dot at
[2014-05-28 15:00 UTC] bwoebi@php.net
-Status: Open
+Status: Not a bug
[2014-05-28 15:00 UTC] bwoebi@php.net
[2014-05-29 09:32 UTC] fleshgrinder at gmx dot at
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 15:00:01 2026 UTC |
Description: ------------ Accessing static properties is inconsistent and doesn't make much sense. Test script: --------------- class Foo { public static $foo = "foo"; } class Bar { public $foo; public function __construct() { $this->foo = new Foo(); } } Expected result: ---------------- Either $foo::$foo to result in some kind of ERROR or WARNING or $bar->foo::$foo has to work as well. Otherwise it's not consistent. Actual result: -------------- $foo = new Foo(); echo $foo::$foo; // Works and prints 'foo' echo $foo->foo; // STRICT WARNING echo $foo->$foo; // FATAL ERROR $bar = new Bar(); echo $bar->foo::$foo; // PARSE ERROR echo $bar->foo->foo; // STRICT WARNING echo $bar->foo->$foo; // FATAL ERROR