Possible null pointer dereference in php_http_url_mod() fixed.
[m6w6/ext-http] / tests / gh-issue7.phpt
1 --TEST--
2 crash with querystring and exception from error handler
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 if (version_compare(PHP_VERSION, "7", ">=")) {
7 die("skip PHP>=7\n");
8 }
9 ?>
10 --GET--
11 q[]=1&r[]=2
12 --FILE--
13 <?php
14 echo "Test\n";
15
16 set_error_handler(function($c,$e) { throw new Exception($e); });
17
18 try {
19 $q = http\QueryString::getGlobalInstance();
20 var_dump($q->get("q","s"));
21 } catch (\Exception $e) {
22 echo $e->getMessage(),"\n";
23 }
24 try {
25 $r = new http\Env\Request;
26 var_dump($r->getQuery("r", "s"));
27 } catch (\Exception $e) {
28 echo $e->getMessage(),"\n";
29 }
30
31 ?>
32 ===DONE===
33 --EXPECT--
34 Test
35 Array to string conversion
36 Array to string conversion
37 ===DONE===