123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- --TEST--
- PHP 7.4 test.
- --RULESET--
- {
- "@Symfony": true,
- "array_syntax": false,
- "braces": false,
- "braces_position": false,
- "class_definition": false,
- "curly_braces_position": false,
- "no_null_property_initialization": true,
- "no_unset_on_property": true,
- "pow_to_exponentiation": true,
- "trailing_comma_in_multiline": {"after_heredoc": true},
- "visibility_required": false
- }
- --REQUIREMENTS--
- {"php": 70400}
- --EXPECT--
- <?php
- // https://wiki.php.net/rfc/numeric_literal_separator
- echo 10_0 ** 2;
- if (1_000 === $b);
- // https://wiki.php.net/rfc/null_coalesce_equal_operator
- $a ??= 1;
- $a ??= $b;
- // https://wiki.php.net/rfc/spread_operator_for_array
- $x = array(...$foo);
- $x = [...$foo];
- $x = array(...$foo, ...$bar);
- $x = [...$foo, ...$bar];
- $x = array(
- ...$foo,
- ...$bar,
- );
- $x = [
- ...$foo,
- ...$bar,
- ];
- $x = array(...$foo, ...$bar);
- $x = [...$foo, ...$bar];
- // https://wiki.php.net/rfc/typed_properties_v2
- class Foo {
- private ?int $foo;
- protected string $bar;
- public iterable $baz;
- var ?Foo\Bar $qux;
- }
- // https://wiki.php.net/rfc/arrow_functions_v2
- $foo = fn ($v) => (string) $v;
- --INPUT--
- <?php
- // https://wiki.php.net/rfc/numeric_literal_separator
- echo pow(10_0, 2);
- if ($b === 1_000);
- // https://wiki.php.net/rfc/null_coalesce_equal_operator
- $a??=1;
- $a ??= $b;
- // https://wiki.php.net/rfc/spread_operator_for_array
- $x = array(...$foo, );
- $x = [...$foo, ];
- $x = array(...$foo , ...$bar);
- $x = [...$foo , ...$bar];
- $x = array(
- ...$foo,
- ...$bar
- );
- $x = [
- ...$foo,
- ...$bar
- ];
- $x = array(...$foo,...$bar);
- $x = [...$foo,...$bar];
- // https://wiki.php.net/rfc/typed_properties_v2
- class Foo {
- private ?int $foo;
- protected string $bar;
- public iterable $baz;
- var ? Foo\Bar $qux;
- }
- // https://wiki.php.net/rfc/arrow_functions_v2
- $foo = fn ($v)=> (string)$v;
|