xref: /PHP-8.2/Zend/tests/bug74657.phpt (revision d30cd7d7)
1--TEST--
2Bug #74657 (Undefined constants in array properties result in broken properties)
3--FILE--
4<?php
5
6interface I {
7}
8
9class C {
10    const FOO = I::FOO;
11
12    public $options = [self::FOO => "bar"];
13}
14
15try {
16    var_dump((new C)->options);
17} catch (Throwable $e) {}
18
19var_dump((new C)->options);
20?>
21--EXPECTF--
22Fatal error: Uncaught Error: Undefined constant I::FOO in %s:%d
23Stack trace:
24#0 {main}
25  thrown in %sbug74657.php on line %d
26