summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70918.phpt
blob: 54f3a3c72a80bd8e39faf7003caf11e3ac8b3ef3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--TEST--
Bug #70918 (Segfault using static outside of class scope)
--FILE--
<?php
try {
    static::x;
} catch (Error $e) {
    var_dump($e->getMessage());
}

try {
    parent::x;
} catch (Error $e) {
    var_dump($e->getMessage());
}

try {
    self::x;
} catch (Error $e) {
    var_dump($e->getMessage());
}

try {
    new static;
} catch (Error $e) {
    var_dump($e->getMessage());
}

try {
    static::x();
} catch (Error $e) {
    var_dump($e->getMessage());
}

try {
    static::$i;
} catch (Error $e) {
    var_dump($e->getMessage());
}
?>
--EXPECT--
string(52) "Cannot access "static" when no class scope is active"
string(52) "Cannot access "parent" when no class scope is active"
string(50) "Cannot access "self" when no class scope is active"
string(52) "Cannot access "static" when no class scope is active"
string(52) "Cannot access "static" when no class scope is active"
string(52) "Cannot access "static" when no class scope is active"