xref: /PHP-7.4/tests/lang/bug23384.phpt (revision 782352c5)
1--TEST--
2Bug #23384 (use of class constants in statics)
3--FILE--
4<?php
5define('TEN', 10);
6class Foo {
7    const HUN = 100;
8    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--EXPECTF--
22Deprecated: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d
23Array
24(
25    [100] => ten
26)
27Array
28(
29    [10] => ten
30)
31100100
32