1--TEST--
2Error when fetching properties on non-enums in constant expressions is catchable
3--FILE--
4<?php
5
6class A {
7    public $prop = 42;
8}
9
10function foo($prop = (new A)->prop) {}
11
12function test() {
13    try {
14        foo();
15    } catch (Error $e) {
16        echo $e->getMessage(), "\n";
17    }
18}
19
20test();
21test();
22
23?>
24--EXPECT--
25Fetching properties on non-enums in constant expressions is not allowed
26Fetching properties on non-enums in constant expressions is not allowed
27