xp-framework / compiler

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

Omit constant types for all PHP versions < 8.3 #165

Closed thekid closed 1 year ago

thekid commented 1 year ago
$ echo '<?php class T { const string NAME= "Test"; }' | xp compile -t php:8.2 -q -
<?php  class T{ const  NAME="Test";static function __init() {}} T::__init();;
# ^^^^^^^^^^^^^^^^^^^^
# Type is omitted

$ echo '<?php class T { const string NAME= "Test"; }' | xp compile -t php:8.3 -q -
<?php  class T{ const string NAME="Test";static function __init() {}} T::__init();;
# ^^^^^^^^^^^^^^^^^^^^
# Typed with string

See #157