Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,15 @@ $a = (
if (true) {} ( 1+2) === 3 ? $a = 1 : $a = 2;
class A {} ( 1+2) === 3 ? $a = 1 : $a = 2;
function foo() {} ( 1+2) === 3 ? $a = 1 : $a = 2;

// Issue #3618.
class NonArbitraryParenthesesWithKeywords {
public static function baz( $foo, $bar ) {
$a = new self();
$b = new parent();
$c = new static();

// self/static are already tested above, round line 45.
$d = new parent( $foo,$bar );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,15 @@ $a = (
if (true) {} (1+2) === 3 ? $a = 1 : $a = 2;
class A {} (1+2) === 3 ? $a = 1 : $a = 2;
function foo() {} (1+2) === 3 ? $a = 1 : $a = 2;

// Issue #3618.
class NonArbitraryParenthesesWithKeywords {
public static function baz( $foo, $bar ) {
$a = new self();
$b = new parent();
$c = new static();

// self/static are already tested above, round line 45.
$d = new parent( $foo,$bar );
}
}
1 change: 1 addition & 0 deletions src/Util/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ final class Tokens
T_UNSET => T_UNSET,
T_EMPTY => T_EMPTY,
T_SELF => T_SELF,
T_PARENT => T_PARENT,
T_STATIC => T_STATIC,
];

Expand Down