1--TEST--
2Places where new is allowed
3--FILE--
4<?php
5
6#[SomeAttribute(new stdClass)]
7class Test {
8    public function __construct(
9        public $prop = new stdClass,
10    ) {
11        var_dump($prop);
12    }
13}
14
15function test($param = new stdClass) {
16    static $var = new stdClass;
17    var_dump($param, $var);
18}
19
20const TEST = new stdClass;
21
22new Test;
23test();
24var_dump(TEST);
25
26?>
27--EXPECT--
28object(stdClass)#3 (0) {
29}
30object(stdClass)#2 (0) {
31}
32object(stdClass)#3 (0) {
33}
34object(stdClass)#1 (0) {
35}
36