- bugs
[m6w6/ext-http] / tests / split_response_002.phpt
diff --git a/tests/split_response_002.phpt b/tests/split_response_002.phpt
new file mode 100644 (file)
index 0000000..820c1e6
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+http_split_response() list bug (mem-leaks)
+--SKIPIF--
+<?php
+include 'skip.inc';
+?>
+--FILE--
+<?php
+$data = "HTTP/1.1 200 Ok\r\nContent-Type: text/plain\r\nContent-Language: de-AT\r\nDate: Sat, 22 Jan 2005 18:10:02 GMT\r\n\r\nHallo Du!";
+// this generates mem-leaks - no idea how to fix them
+class t { 
+       var $r = array(); 
+       function fail($data) {
+               list($this->r['headers'], $this->r['body']) = http_split_response($data);
+       }
+}
+
+$t = new t;
+$t->fail($data);
+echo "Done\n";
+?>
+--EXPECTF--
+Content-type: text/html
+X-Powered-By: PHP/%s
+
+Done
+