xref: /PHP-8.0/ext/mysqli/tests/bug64726.phpt (revision fcabe693)
1--TEST--
2Bug #63398 (Segfault when calling fetch_object on a use_result and DB pointer has closed)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once("connect.inc");
7if (!$IS_MYSQLND) {
8    die("skip mysqlnd only test");
9}
10require_once('skipifconnectfailure.inc');
11?>
12--FILE--
13<?php
14require 'connect.inc';
15$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
16
17mysqli_report(MYSQLI_REPORT_ERROR);
18$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
19$db->close();
20var_dump($result->fetch_object());
21?>
22--EXPECTF--
23Warning: mysqli_result::fetch_object(): (HY000/2014): Commands out of sync; you can't run this command now in %s on line %d
24bool(false)
25