xref: /PHP-8.4/tests/lang/bug23384.phpt (revision 6c73b50c)
1--TEST--
2Bug #23384 (use of class constants in statics)
3--FILE--
4<?php
5define('TEN', 10);
6class Foo {
7    const HUN = 100;
8    static function test($x = Foo::HUN) {
9        static $arr2 = array(TEN => 'ten');
10        static $arr = array(Foo::HUN => 'ten');
11
12        print_r($arr);
13        print_r($arr2);
14        print_r($x);
15    }
16}
17
18Foo::test();
19echo Foo::HUN."\n";
20?>
21--EXPECT--
22Array
23(
24    [100] => ten
25)
26Array
27(
28    [10] => ten
29)
30100100
31