Skip to content

Commit b7764dc

Browse files
committed
Use () instead of {} for new as well
1 parent 4ea9c68 commit b7764dc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Zend/tests/varSyntax/new_instanceof_expr.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ new with an arbitrary expression
44
<?php
55

66
$class = 'class';
7-
var_dump(new {'std'.$class});
8-
var_dump(new {'std'.$class}());
7+
var_dump(new ('std'.$class));
8+
var_dump(new ('std'.$class)());
99
$obj = new stdClass;
1010
var_dump($obj instanceof ('std'.$class));
1111

Zend/zend_language_parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ instanceof_class_name:
10841084
new_class_name:
10851085
class_name { $$ = $1; }
10861086
| new_variable { $$ = $1; }
1087-
| '{' expr '}' { $$ = $2; }
1087+
| '(' expr ')' { $$ = $2; }
10881088
;
10891089

10901090
exit_expr:

0 commit comments

Comments
 (0)