123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- --TEST--
- PHP 8.1 test.
- --RULESET--
- {
- "@PhpCsFixer": true,
- "@PHP81Migration": true
- }
- --REQUIREMENTS--
- {"php": 80100}
- --EXPECT--
- <?php
- // https://wiki.php.net/rfc/readonly_properties_v2
- final class Foo
- {
- public readonly string $c;
- public readonly string $prop;
- public readonly string $b;
- }
- // https://wiki.php.net/rfc/noreturn_type
- function endProgram(): never
- {
- exit;
- }
- // https://wiki.php.net/rfc/fsync_function
- fsync($fp);
- $a = fdatasync($fp);
- // https://wiki.php.net/rfc/explicit_octal_notation
- $a = 0o16 === 14;
- $b = 0o744;
- // https://wiki.php.net/rfc/is_list
- $a = array_is_list($z);
- // https://wiki.php.net/rfc/final_class_const
- interface I
- {
- final public const Y = 'i';
- }
- // https://wiki.php.net/rfc/fsync_function
- fsync($fp);
- // https://wiki.php.net/rfc/explicit_octal_notation
- 0o16 === 14;
- // https://wiki.php.net/rfc/new_in_initializers
- class TestNewWithInitialiers
- {
- public function __construct(
- private Logger $logger = new NullLogger(),
- ) {}
- }
- --INPUT--
- <?php
- // https://wiki.php.net/rfc/readonly_properties_v2
- final class Foo
- {
- public READONLY string $c;
- READONLY string $prop, $b;
- }
- // https://wiki.php.net/rfc/noreturn_type
- function endProgram(): NEVER
- {
- die();
- }
- // https://wiki.php.net/rfc/fsync_function
- FSYNC($fp);
- $a = Fdatasync($fp);
- // https://wiki.php.net/rfc/explicit_octal_notation
- $a = 0O16 === 14;
- $b = 0744;
- // https://wiki.php.net/rfc/is_list
- $a = Array_Is_List($z);
- // https://wiki.php.net/rfc/final_class_const
- interface I
- {
- FINAL PUBLIC CONST Y = "i";
- }
- // https://wiki.php.net/rfc/fsync_function
- FSYNC($fp);
- // https://wiki.php.net/rfc/explicit_octal_notation
- 0O16 === 14;
- // https://wiki.php.net/rfc/new_in_initializers
- class TestNewWithInitialiers
- {
- public function __construct(
- private Logger $logger = new NullLogger,
- ) {
- }
- }
|