summaryrefslogtreecommitdiff
path: root/Zend/tests/class_name_as_scalar_error_007.phpt
blob: a550cdd2b06d35e5d9b36827131f632e5b1efe32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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