mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
3ae995f03c
This implements a reduced variant of #1226 with just the following change: -Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d +Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d The '' wrapper around messages is very weird if the exception message itself contains ''. Futhermore having the message wrapped in '' doesn't work for the "and defined" suffix of TypeExceptions.
53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
--TEST--
|
|
Bug #64720 (SegFault on zend_deactivate)
|
|
--FILE--
|
|
<?php
|
|
class Stat {
|
|
private static $requests;
|
|
public static function getInstance() {
|
|
if (!isset(self::$requests[1])) {
|
|
self::$requests[1] = new self();
|
|
}
|
|
return self::$requests[1];
|
|
}
|
|
|
|
public function __destruct() {
|
|
unset(self::$requests[1]);
|
|
}
|
|
}
|
|
|
|
class Foo {
|
|
public function __construct() {
|
|
Stat::getInstance();
|
|
}
|
|
}
|
|
|
|
class Error {
|
|
private $trace;
|
|
public function __construct() {
|
|
$this->trace = debug_backtrace(1);
|
|
}
|
|
}
|
|
|
|
class Bar {
|
|
public function __destruct() {
|
|
Stat::getInstance();
|
|
new Error();
|
|
}
|
|
|
|
public function test() {
|
|
new Error();
|
|
}
|
|
}
|
|
|
|
$foo = new Foo();
|
|
$bar = new Bar();
|
|
$bar->test();
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught EngineException: Access to undeclared static property: Stat::$requests in %sbug64720.php:12
|
|
Stack trace:
|
|
#0 [internal function]: Stat->__destruct()
|
|
#1 {main}
|
|
thrown in %sbug64720.php on line 12
|