xref: /PHP-8.1/ext/mysqli/tests/bug64726.phpt (revision d001682a)
1--TEST--
2Bug #63398 (Segfault when calling fetch_object on a use_result and DB pointer has closed)
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$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
17
18mysqli_report(MYSQLI_REPORT_ERROR);
19$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
20$db->close();
21var_dump($result->fetch_object());
22?>
23--EXPECTF--
24Warning: mysqli_result::fetch_object(): (HY000/2014): Commands out of sync; you can't run this command now in %s on line %d
25bool(false)
26