fix leaks / invalid frees
[m6w6/ext-http] / tests / message013.phpt
1 --TEST--
2 message detach
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 echo "Test\n";
11
12 $m = new http\Message(
13 "HTTP/1.1 200 Ok\r\n".
14 "HTTP/1.1 201 Created\n".
15 "HTTP/1.1 302 Found\r\n"
16 );
17
18 var_dump(3 === count($m));
19 $d = $m->detach();
20 var_dump(3 === count($m));
21 var_dump(1 === count($d));
22
23 var_dump("HTTP/1.1 302 Found\r\n\r\n" === $d->toString(true));
24
25 ?>
26 Done
27 --EXPECTF--
28 Test
29 bool(true)
30 bool(true)
31 bool(true)
32 bool(true)
33 Done