mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
9b3fda4342
Instead delay this until const expression compilation. Otherwise self::class and [self::class] have different behavior...
21 lines
372 B
PHP
21 lines
372 B
PHP
--TEST--
|
|
Cannot access self::class when no class scope is active
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
var_dump(self::class);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump([self::class]);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Cannot use "self" when no class scope is active
|
|
Cannot use "self" when no class scope is active
|