Req #67347 [NEW]: Access to static class properties inconsistent
| From: | fleshgrinder at gmx dot at | Date: | Tue, 27 May 2014 19:42:54 +0000 |
| Subject: | Req #67347 [NEW]: Access to static class properties inconsistent | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185938@lists.php.net to get a copy of this message | ||
From: fleshgrinder at gmx dot at
Operating system: Debian Wheezy
PHP version: 5.6.0beta3
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:Access to static class properties inconsistent
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
--
Edit bug report at https://bugs.php.net/bug.php?id=67347&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67347&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67347&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67347&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67347&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67347&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67347&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67347&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67347&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67347&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67347&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67347&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67347&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67347&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67347&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67347&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67347&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67347&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67347&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67347&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67347&r=mysqlcfg