On 15/11/2021 16:23, Andreas Heigl wrote:
One thing, that can verify the correct working of properties, whether that is dynamic or static ones, is testing.


Can it? I can't actually see how that would work, without also having a way to detect when dynamic properties were accessed, which brings us full circle. Also:


So the mistakes-part would be easy to handle.

If you are working with a million lines of code going back 20 years, "write tests for everything" is not "easy to handle"; it's a long-term ambition which you chip away at when priorities allow.

"Logging all deprecations and warnings on a production workload", however, *is* easy to handle. Diagnostic messages in logs are the *only* way this behaviour will be spotted in old code.


What I am still missing is the differentiation between "everything is strict and you have to explicitly opt-in to make it dynamic" and an "everything is dynamic and you can use a marker to mark this explicitly an intended behaviour". That would allow users to mark a class explicitly to use dynamic features even though it would make no difference code-wise.


I'm not sure what you mean by that. Do you mean, create the attribute, but don't actually do anything with it? Would the plan be to deprecate later? Never remove at all?

Regards,

--
Rowan Tommins
[IMSoP]

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

Reply via email to