php-8.0.30-src/Zend/tests/class_name_as_scalar_error_...

21 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