|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
Submitted: 2017-07-22 04:56 UTC Modified: -
From: toto at linux dot com Assigned:
Status: Closed Package: MySQLi related
PHP Version: 7.1.7 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
38 - 30 = ?
Subscribe to this entry?

 [2017-07-22 04:56 UTC] toto at linux dot com
So I wrote some faulty code this morning that tried to do $mysqli_result->fetch_object("SomeAbstractClass"); and it ended up crashing the whole PHP.

I tested this also on PHP 7.0.18 on Ubuntu and it also ended up with a segmentation fault.

Test script:
$mysqli = new mysqli("", "xxx", "xxx", "test");
abstract class test {
    public $a;
$mysqli->query("SELECT 1 as a")->fetch_object("test");

Expected result:
PHP should give me some error instead of just crashing.

Actual result:
Segmentation fault, the whole PHP crashes.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-22 08:37 UTC]
Automatic comment on behalf of ab
Log: Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
 [2017-07-22 08:37 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Apr 05 01:01:24 2020 UTC