xref: /PHP-8.1/ext/mysqli/tests/bug74968.phpt (revision b5a14e6c)
1--TEST--
2Bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11    require_once("connect.inc");
12
13    $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
14    abstract class test {
15        public $a;
16    }
17    $mysqli->query("SELECT 1 as a")->fetch_object("test");
18?>
19==DONE==
20--EXPECTF--
21Fatal error: Uncaught Error: Class test cannot be instantiated in %sbug74968.php:%d
22Stack trace:
23#0 %sbug74968.php(%d): mysqli_result->fetch_object('test')
24#1 {main}
25  thrown in %sbug74968.php on line %d
26