Hello Folks,

  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?

best regards
marcus


Thursday, April 27, 2006, 4:35:39 PM, you wrote:

> Hi Marcus,

> Marcus Boerger wrote:
>> There was no endless discussion like we to often do on the list but instead
>> it was just something we came to agree upon among those implementing it
>> while implementing it.

> In other words there was no public discussion whatsoever ;)

> Well since we're are talking about the future direction of PHP, I guess
> the question deserves some attention. I strongly disagree with this
> approach of making PHP more "strict" and static. I really liked its
> dynamicity and would not like to see it disappear under the pressure
> from people who think Java or C++ (or any other langauge) are cool. For
> me *PHP* is the cool language.

> I would really like to hear what do PHP group members/core developers
> think about this.

>>>class foo{}; foo::$bar = 1;
>>
>> To cut the story short, any feature might have an advantage for somebody but
>> also a heavy disadvantage for somebody else. But in the end if we'd agree to
>> add this feature we#d also end up in supporting interception of static
>> properties which we probably do not want.

> Mike has already demonstrated that the patch to implement this
> particular feature is very simple:
> http://dev.iworks.at/PATCHES/dyn_static.txt

> Edin




Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to