12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- --TEST--
- PHP 7.1 test.
- --RULESET--
- {
- "@Symfony": true
- }
- --EXPECT--
- <?php
- function iterable_foo(iterable $foo): void
- {
- try {
- $str = 'abcdef';
- echo $str[-2];
- } catch (ExceptionType1|ExceptionType2 $e) {
- // Code to handle the exception
- } catch (Exception $e) {
- // ...
- }
- }
- class A
- {
- public const b = 1;
- }
- interface Contract
- {
- public function method(?Foo $foo): ?bool;
- }
- class Implementation implements Contract
- {
- public function method(?Foo $foo = null): ?bool
- {
- return is_null($foo);
- }
- }
- list(list('x' => $x1, 'y' => $y1), list('x' => $x2, 'y' => $y2)) = $points;
- list('first' => list($x1, $y1), 'second' => list($x2, $y2)) = $points;
- [$a, $b, $c] = [1, 2, 3];
- --INPUT--
- <?php
- function iterable_foo(iterable$foo) : void {try{$str='abcdef'; echo $str[ -2 ]; } catch (ExceptionType1 | ExceptionType2 $e) {
- // Code to handle the exception
- } catch (\Exception $e) {
- // ...
- }}
- class A
- {
- PUBLIC CONST b = 1;
- }
- interface Contract {
- public function method(?Foo $foo): ?bool;
- }
- class Implementation implements Contract {
- public function method(Foo $foo = null): ?bool
- {
- return is_null($foo);
- }
- }
- list(list("x" => $x1, "y" => $y1), list("x" => $x2, "y" => $y2)) = $points;
- list("first" => list($x1, $y1), "second" => list($x2, $y2)) = $points;
- [$a, $b, $c] = [1, 2, 3];
|