xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Support dynamic class constant fetch #161

Closed thekid closed 1 year ago

thekid commented 1 year ago

See https://wiki.php.net/rfc/dynamic_class_constant_fetch and https://github.com/php/php-src/pull/9793

This pull request also fixes support for dynamic static properties.

thekid commented 1 year ago

Tests are failing because of version constraint conflict for xp-framework/ast: The test library wants ^9.x, we're using the development branch feature/expressions as version 10.0.0

For the time being, we can use as 9.99.0, but when xp-framework/ast#44 is merged, we'll have to release xp-framework/test with an updated constraint before releasing xp-framework/compiler!

thekid commented 1 year ago

Performance and memory figures indicate no significant change:

Before

Test cases:  917 succeeded, 4 skipped
Memory used: 11181.34 kB (11235.46 kB peak)
Time taken:  0.262 seconds (0.760 seconds overall)

After

Test cases:  933 succeeded, 4 skipped
Memory used: 11413.18 kB (11467.31 kB peak)
Time taken:  0.251 seconds (0.720 seconds overall)
thekid commented 1 year ago

Added to https://github.com/xp-framework/compiler/wiki/Implementation-status. This is the first PHP 8.3 feature to go into the compiler although PHP 8.3 is still quite a while away at the time of writing.

thekid commented 1 year ago

Released in https://github.com/xp-framework/compiler/releases/tag/v8.10.0

thekid commented 1 year ago

The typical upgrade process will show: