Req #63471 [NEW]: Make properties final on runtime
| From: | daniel at baz-x dot at | Date: | Fri, 09 Nov 2012 09:59:05 +0000 |
| Subject: | Req #63471 [NEW]: Make properties final on runtime | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-174594@lists.php.net to get a copy of this message | ||
From: daniel at baz-x dot at
Operating system: Any
PHP version: 5.4.8
Package: Reflection related
Bug Type: Feature/Change Request
Bug description:Make properties final on runtime
Description:
------------
I have developed a class that tries to mimic java like enums as much as
possible
(only the simple ones, see provided urls for the example). The only
difficulty I
got is that it's still possible to overwrite the static variables which
makes the
enum quite insecure.
As I would like to keep it as much as it's like in java I would like to
request
for a reflection method to make properties final (at least for the static
ones)
like ReflectionProperty->setFinal().
Test script:
---------------
Enum class:
https://dl.dropbox.com/u/11045888/Enum.php.txt
Implementation:
https://dl.dropbox.com/u/11045888/QueryType.php.txt
--
Edit bug report at https://bugs.php.net/bug.php?id=63471&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63471&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63471&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63471&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63471&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63471&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63471&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63471&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63471&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63471&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63471&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63471&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63471&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63471&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63471&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63471&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63471&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63471&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63471&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63471&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63471&r=mysqlcfg