Bug #74968 [NEW]: PHP crashes when calling mysqli_result::fetch_object with an abstract class

From: Date: Sat, 22 Jul 2017 04:57:02 +0000
Subject: Bug #74968 [NEW]: PHP crashes when calling mysqli_result::fetch_object with an abstract class
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210180@lists.php.net to get a copy of this message
From: toto at linux dot com Operating system: Windows PHP version: 7.1.7 Package: MySQLi related Bug Type: Bug Bug description:PHP crashes when calling mysqli_result::fetch_object with an abstract class Description: ------------ 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: --------------- <?php $mysqli = new mysqli("127.0.0.1", "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. -- Edit bug report at https://bugs.php.net/bug.php?id=74968&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74968&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74968&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74968&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74968&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74968&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74968&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74968&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74968&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74968&r=support Expected behavior: https://bugs.php.net/fix.php?id=74968&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74968&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74968&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74968&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74968&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74968&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74968&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74968&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74968&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74968&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74968&r=mysqlcfg

« previous php.bugs (#210180) next »