We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 357fbc9 commit c141ee3Copy full SHA for c141ee3
Zend/tests/varSyntax/new_instanceof_expr.phpt
@@ -0,0 +1,18 @@
1
+--TEST--
2
+new with an arbitrary expression
3
+--FILE--
4
+<?php
5
+
6
+$class = 'class';
7
+var_dump(new ('std'.$class));
8
+var_dump(new ('std'.$class)());
9
+$obj = new stdClass;
10
+var_dump($obj instanceof ('std'.$class));
11
12
+?>
13
+--EXPECT--
14
+object(stdClass)#1 (0) {
15
+}
16
17
18
+bool(true)
Zend/zend_language_parser.y
@@ -1078,6 +1078,7 @@ class_name:
1078
class_name_reference:
1079
class_name { $$ = $1; }
1080
| new_variable { $$ = $1; }
1081
+ | '(' expr ')' { $$ = $2; }
1082
;
1083
1084
exit_expr:
0 commit comments