8282c84900359bce9e26d8ab53d48e70aec3c572
[m6w6/ext-http] / tests / bug_15800.phpt
1 --TEST--
2 Bug #15800 Double free when zval is separated in convert_to_*
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkmin("5.2.5");
7 checkcls('HttpRequest');
8 skipif(!function_exists('debug_zval_dump'), "need DEBUG version of PHP");
9 ?>
10 --FILE--
11 <?php
12 echo "-TEST\n";
13 $o = array('ssl' => array('verifypeer'=>'1'));
14 debug_zval_dump($o);
15
16 $r = new HttpRequest('http://www.google.com');
17 $r->setOptions($o);
18 $r->send();
19 debug_zval_dump($o);
20
21 unset($r);
22 debug_zval_dump($o);
23
24 echo "Done\n";
25 ?>
26 --EXPECTF--
27 %aTEST
28 array(1) refcount(2){
29 ["ssl"]=>
30 array(1) refcount(1){
31 ["verifypeer"]=>
32 string(1) "1" refcount(1)
33 }
34 }
35 array(1) refcount(2){
36 ["ssl"]=>
37 array(1) refcount(1){
38 ["verifypeer"]=>
39 string(1) "1" refcount(2)
40 }
41 }
42 array(1) refcount(2){
43 ["ssl"]=>
44 array(1) refcount(1){
45 ["verifypeer"]=>
46 string(1) "1" refcount(1)
47 }
48 }
49 Done