xp-framework / core

The XP Framework is an all-purpose, object oriented PHP framework.
Other
19 stars 6 forks source link

Support PHP 8.1 `never` type in reflection #267

Closed thekid closed 3 years ago

thekid commented 3 years ago

Forward compatible but also supports apidoc / syntax combination:

/** @return never */
public function halt(): void { exit(); }

The reflection API lets apidoc take precedence over the void return type declared syntactically, as is done for e.g. callable and arrays

See https://wiki.php.net/rfc/noreturn_type. Implements runtime support for xp-framework/compiler#109