xref: /PHP-5.3/ext/mysqli/tests/bug33491.phpt (revision 636d1b08)
1--TEST--
2Bug #33491 (extended mysqli class crashes when result is not object)
3--INI--
4error_reporting=4095
5--SKIPIF--
6<?php
7require_once('skipif.inc');
8require_once('skipifconnectfailure.inc');
9?>
10--FILE--
11<?php
12
13class DB extends mysqli
14{
15  public function query_single($query) {
16    $result = parent::query($query);
17    $result->fetch_row(); // <- Here be crash
18  }
19}
20
21require_once("connect.inc");
22
23// Segfault when using the DB class which extends mysqli
24$DB = new DB($host, $user, $passwd, $db, $port, $socket);
25$DB->query_single('SELECT DATE()');
26
27?>
28--EXPECTF--
29Fatal error: Call to a member function fetch_row() on a non-object in %sbug33491.php on line %d
30