xp-framework / compiler

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

Integrate throw expression #85

Closed thekid closed 4 years ago

thekid commented 4 years ago

lang.ast.syntax.php.ThrowExpression can be integrated as throw expressions are now part of PHP 8, see https://wiki.php.net/rfc/throw_expression

$ XP_RT=8.0 xp -w 'return $args[1] ?? throw new \lang\IllegalArgumentException("Missing arg")'
Uncaught exception: Exception lang.IllegalArgumentException (Missing arg)
  at <main>::include() [line 154 of Code.class.php]
  at xp.runtime.Code::run(array[1]) [line 30 of Dump.class.php]
  at xp.runtime.Dump::main(array[1]) [line 381 of class-main.php]