Hi Marco,

On 10/03/2019 18:51, Marco Pivetta wrote:
Overall good idea, except that I disagree with the `unset()` being disabled: that bit is strictly required for lazy-loading purposes, and mostly harmless for userland ("normal" people don't do it, libraries do it).


To me, the unset() restriction fits naturally into the definition; I think most people would consider "removing a property" in the same category as "adding a property". Notably, it's included in ECMAScript's definition of sealed objects [1], which is essentially the same feature.

I understand that unset() currently enables a neat trick for lazy-loading, but it feels like just that to me: a trick, not a core part of the language. Similarly, there may be tricks that rely on adding dynamic properties to objects, but that's fine, just don't mark those classes as "locked".


[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal

Regards,

--
Rowan Collins
[IMSoP]


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

Reply via email to