xp-framework / compiler

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

Typed class constants support #157

Closed thekid closed 1 year ago

thekid commented 1 year ago

In a nutshell

class T {
  public const string NAME= 'Test';
}

See also

thekid commented 1 year ago

The RFC has been accepted, need to wait for https://github.com/php/php-src/pull/10444 before adding this to the PHP 8.3 emitter.

thekid commented 1 year ago

PR has been merged, the build from https://github.com/shivammathur/php-builder-windows/actions/runs/4715949822 contains the change:

$ XP_RT=8.3 xp -w 'class T { const string NAME= "Test"; } return T::NAME'
Test
thekid commented 1 year ago

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