xref: /PHP-8.4/ext/mysqli/tests/bug64726.phpt (revision a21edc52)
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 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11require 'connect.inc';
12$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
13
14mysqli_report(MYSQLI_REPORT_ERROR);
15$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
16$db->close();
17var_dump($result->fetch_object());
18?>
19--EXPECTF--
20Warning: mysqli_result::fetch_object(): (HY000/2014): Commands out of sync; you can't run this command now in %s on line %d
21bool(false)
22