On 11.08.20 18:38, Sara Golemon wrote:
The perf penalty on 7 and earlier would probably be similar to existing state of the world. Parsing a docblock is easier to fetch from the runtime (as we actually store it), but docblocks contain more than just annotations, so some plus some minus. PHP 8+ performance on theses would certainly be between though, and that's an extra carrot to push users to upgrade. If annotations can't be written until after users upgrade, then that carrot vanishes.
If this is something that would realistically happen, I feel this would have needed more explanation in an RFC and maybe some small tests to demonstrate feasability, then it would be a big argument. I read through all the RFCs, but only realized the meaning of this argument now, with some more context. If the Doctrine Annotations library would support a syntax with # for pre-PHP-8 and it would be fast enough, then this argument would be more convincing to me than any of the others together. And it would not need to be #[], it could be any syntax that starts with # - it could also be #@, which definitely seems weird at first, but seems much less likely to occur in code than #[ and would be more similar to current annotations and Javascript syntax. Or it could be something completely different, like #~, which I cannot imagine ever comes up in actual code. Because Rust using the #[] syntax does not seem like an advantage, as Rust syntax in general looks completely different compared to PHP. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php