]> granicus.if.org Git - php/commitdiff
Added test
authorDmitry Stogov <dmitry@zend.com>
Tue, 7 Jun 2016 11:08:12 +0000 (14:08 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 7 Jun 2016 11:08:12 +0000 (14:08 +0300)
ext/curl/tests/bug72202.phpt [new file with mode: 0644]

diff --git a/ext/curl/tests/bug72202.phpt b/ext/curl/tests/bug72202.phpt
new file mode 100644 (file)
index 0000000..63138d9
--- /dev/null
@@ -0,0 +1,36 @@
+--TEST--
+Bug #72202 (curl_close doesn't close cURL handle)
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) {
+       exit("skip curl extension not loaded");
+}
+if (getenv("SKIP_ONLINE_TESTS")) {
+       die("skip online test");
+}
+?>
+--FILE--
+<?php
+$a = fopen(__FILE__, "r");
+$b = $a;
+var_dump($a, $b);
+fclose($a);
+var_dump($a, $b);
+unset($a, $b);
+
+$a = curl_init();
+$b = $a;
+var_dump($a, $b);
+curl_close($a);
+var_dump($a, $b);
+unset($a, $b);
+?>
+--EXPECTF--
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+resource(%d) of type (Unknown)
+resource(%d) of type (Unknown)
+resource(%d) of type (curl)
+resource(%d) of type (curl)
+resource(%d) of type (Unknown)
+resource(%d) of type (Unknown)