php-src/Zend/tests/class_name_as_scalar_error_007.phpt
2020-07-10 21:05:28 +02:00

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