xref: /PHP-7.2/Zend/tests/self_in_eval.phpt (revision f1d7e3ca)
1--TEST--
2self etc. can be used in eval() in a class scope
3--FILE--
4<?php
5
6class C {
7    const FOO = 1;
8    private static $bar = 2;
9    public static function f() {
10        eval(<<<'PHP'
11var_dump(self::FOO);
12var_dump(self::$bar);
13var_dump(self::class);
14var_dump(static::class);
15PHP
16        );
17    }
18}
19
20C::f();
21
22?>
23--EXPECT--
24int(1)
25int(2)
26string(1) "C"
27string(1) "C"
28