mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
20 lines
352 B
PHP
20 lines
352 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" in the global scope
|
|
Cannot use "self" in the global scope
|