Hey Nikita.

On 15.11.21 14:50, Nikita Popov wrote:
[...]
I hope that the new "Motivation" section clarifies things a bit, especially
in regards to why "static analysis" is only a partial solution to this
problem: https://wiki.php.net/rfc/deprecate_dynamic_properties#motivation

Thanks for the clarification!

One thing, that can verify the correct working of properties, whether that is dynamic or static ones, is testing. So when one wants to make sure that their code behaves as it should, then proper testing can help with that. So while the static analysis is one possibility, the other one is writing appropriate tests. While that will still not eliminate the usage of external tools it is fore sure something that most of the projects using modern code already implement.

So the mistakes-part would be easy to handle.

Being explicit on the other hand is something that I would very much appreciate. And using an Annotation for that is great. 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.

And that could already be implemented via a userland-shim right now which would then use the Core-Attribute as of PHP8.2

The other thing, that I noticed is that you were speaking of a possible reduction of the object-size by 8 byte. Is there a comparison of how much that would be in percent for some default applications? So is that something that actually "pays off"?

Thanks again for your insights!

Cheers

Andreas
--
                                                              ,,,
                                                             (o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl                                                       |
| mailto:andr...@heigl.org                  N 50°22'59.5" E 08°23'58" |
| https://andreas.heigl.org                                           |
+---------------------------------------------------------------------+
| https://hei.gl/appointmentwithandreas                               |
+---------------------------------------------------------------------+

Attachment: OpenPGP_0xA8D5437ECE724FE5.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to