mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
6ef8ae65a2
This fixes a regression from 16a9bc1ec2
.
Together with the recent closure related changes this should allow
all usages of self etc, while previously (in PHP 5) some things like
self::class did not work.
29 lines
368 B
PHP
29 lines
368 B
PHP
--TEST--
|
|
self etc. can be used in eval() in a class scope
|
|
--FILE--
|
|
<?php
|
|
|
|
class C {
|
|
const FOO = 1;
|
|
private static $bar = 2;
|
|
public static function f() {
|
|
eval(<<<'PHP'
|
|
var_dump(self::FOO);
|
|
var_dump(self::$bar);
|
|
var_dump(self::class);
|
|
var_dump(static::class);
|
|
PHP
|
|
);
|
|
}
|
|
}
|
|
|
|
C::f();
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|
|
int(2)
|
|
string(1) "C"
|
|
string(1) "C"
|
|
|