compiler
compiler copied to clipboard
Compiles future PHP to today's PHP.
This pull request adds support for property hooks to all PHP versions ## Example This example calculates and caches the full name from first and last names ```php class User...
## Proposal Complement the null-coalescing operator: ```php $user= $context->userName() ?? 'guest'; ``` Sometimes we want to perform an action *if* the value is null, and perform an alternative instead: ```php...
Example: ```php $user= $name |> trim(...) |> strtolower(...); // Equivalent of: $user= strtolower(trim($name)); ``` See #180
This ticket tracks the dependencies on XP core: * `cast()` for casting anything other than string, int, float, bool, array and object (and nullable versions of these, see #131) *...
Add `||=` and `&&=` operators accompanying the `??=` operator: ```php $a ||= $b; // equivalent of $a || ($a= $b); $a &&= $b; // equivalent of $a && ($a= $b);...
As noted in the "Future Scope" section of the property hooks RFC, [reusable package hooks](https://wiki.php.net/rfc/property-hooks#reusable_hooks) are not part of the first RFC, but the authors @iluuu1994 and @Crell envision it...
How about using `::namespace` for namespace resolution just like `::class`? Example: ```php
Inspired by https://externals.io/message/119470#119488 and https://wiki.php.net/rfc/local_variable_types ## What we would like to achieve ```php int $i= 0; $i= 'Test'; // Should throw an exception ``` ## How it can be implemented...
See https://wiki.php.net/rfc/dnf_types, accepted in PHP 8.2
Compilers, interpreters, and build pipelines supporting Unicode should throw errors or warnings for unterminated bidirectional control characters in comments or string literals, and for identifiers with mixed-script confusable characters. https://trojansource.codes/...