xref: /PHP-8.1/ext/mysqli/tests/bug63398.phpt (revision b5a14e6c)
1--TEST--
2Bug #63398 (Segfault when polling closed link)
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once("connect.inc");
8if (!$IS_MYSQLND) {
9    die("skip mysqlnd only test");
10}
11require_once('skipifconnectfailure.inc');
12?>
13--FILE--
14<?php
15require 'connect.inc';
16$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
17
18mysqli_close($link);
19
20$read = $error = $reject = array();
21$read[] = $error[] = $reject[] = $link;
22
23try {
24    mysqli_poll($read, $error, $reject, 1);
25} catch (Error $exception) {
26    echo $exception->getMessage() . "\n";
27}
28
29echo "okey";
30?>
31--EXPECT--
32mysqli object is already closed
33okey
34