mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
48 lines
953 B
PHP
48 lines
953 B
PHP
--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"
|