forked from xdebug/xdebug
-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
bug00801.phpt
49 lines (40 loc) · 830 Bytes
/
bug00801.phpt
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
48
49
--TEST--
Test for bug #801: Segfault with streamwrapper, unclosed $fp and xdebug on destruction
--SKIPIF--
<?php
// PHP 5.1 and PHP 5.2 both crash here, without Xdebug loaded
if (!version_compare(phpversion(), "5.3", '>=')) echo "skip >= PHP 5.3 needed\n";
?>
--FILE--
<?php
class Handler
{
protected $_sp;
public function __construct()
{
$this->_sp = fopen('wrap://lalal', 'a');
}
}
class Wrapper
{
protected $_fp;
public function stream_close()
{
die('DONE');
}
public function stream_open($path, $mode)
{
$this->_fp = fopen('/tmp/asdf', $mode);
return true;
}
}
stream_wrapper_register('wrap', 'Wrapper');
class Manager
{
public static $stuff;
}
Manager::$stuff = new stdClass();
Manager::$stuff->Logs = new Handler;
?>
--EXPECT--
DONE