Re: Static properties
| From: | Derick Rethans | Date: | Wed, 03 May 2006 11:29:54 +0000 |
| Subject: | Re: Static properties | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23120@lists.php.net to get a copy of this message | ||
On Tue, 2 May 2006, Marcus Boerger wrote:
> Edin and me discussed the issue a bit more in detail and shared memories
> of discussions from the original php 5.0 development. As a conclusion we
> came to the idea that we should revive the idea of a 'strict flag' that
> decides whether member variables (both static and non static) can be added
> on the fly by simply using them or not. This would for example look like
> this:
>
> strict class FooBar
> {
> }
> $obj = new FooBar;
> $obj->baz = 1; // E_ERROR (a fatal non recoverable error level)
>
> class MyConfig
> {
> }
> MyConfig::$allow_public_access = 1; // works pretty well
>
> Both of us thought this would be a great solution and should suit everybody
> in the php world. Also the possible slowdown would be not measurable since
> it is only a single integer check that in some cases won't have and
> influence on runtime at all.
>
> Any thoughts? Anybody?
I would like this too.
Derick