Req #75359 [NEW]: multiple declaration for visibility or const inline.
| From: | saymongcsw at gmail dot com | Date: | Wed, 11 Oct 2017 12:13:09 +0000 |
| Subject: | Req #75359 [NEW]: multiple declaration for visibility or const inline. | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-15065@lists.php.net to get a copy of this message | ||
From: saymongcsw at gmail dot com
Operating system: irrevelant
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Feature/Change Request
Bug description:multiple declaration for visibility or const inline.
Description:
------------
I've found cool feature that isn't documented yet so it is as undefined
behavior. And works in all PHP since 5.0.2+ and/or earlier.
I.e. missing documentation for multiple declaration visibility and/or
constants.
http://php.net/manual/en/language.oop5.visibility.php
http://php.net/manual/en/language.oop5.constants.php
Demo: https://3v4l.org/qRnlk
Test script:
---------------
<?php
class test1
{
const a = 'b', b = 'a', c = 'c';
public function __construct()
{
echo self::b, self::a, self::c, PHP_EOL;
}
}
class test2
{
private $a = 'b', $b = 'a', $c = 'c';
}
try {
new test1; // abc
echo test2::$b, test2::$a, test2::$c; // Cannot access private
property test2::$b
} catch (Error $e) {
echo $e->getMessage();
}
--
Edit bug report at https://bugs.php.net/bug.php?id=75359&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75359&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75359&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75359&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75359&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75359&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75359&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75359&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75359&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75359&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75359&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75359&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75359&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75359&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75359&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75359&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75359&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75359&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75359&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75359&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75359&r=mysqlcfg