summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2005-06-27 19:07:52 +0000
committerfoobar <sniper@php.net>2005-06-27 19:07:52 +0000
commitb35224fa8107cc2f6a92818bb2fbdfd0c888a150 (patch)
tree8e336685c490b532f0f896e4638e2bc6112f0904 /ext/mysqli
parent1ac5cf874677558fcf623c084ae6f6e279051a56 (diff)
downloadphp-git-b35224fa8107cc2f6a92818bb2fbdfd0c888a150.tar.gz
add test case
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/tests/bug33491.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/mysqli/tests/bug33491.phpt b/ext/mysqli/tests/bug33491.phpt
new file mode 100644
index 0000000000..fb25c8ec63
--- /dev/null
+++ b/ext/mysqli/tests/bug33491.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #33491 (extended mysqli class crashes when result is not object)
+--INI--
+error_reporting=4095
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class DB extends mysqli
+{
+ public function query_single($query) {
+ $result = parent::query($query);
+ $result->fetch_row(); // <- Here be crash
+ }
+}
+
+// Segfault when using the DB class which extends mysqli
+$DB = new DB('localhost', 'root', '', '');
+$DB->query_single('SELECT DATE()');
+
+?>
+--EXPECTF--
+Fatal error: Call to a member function fetch_row() on a non-object in %sbug33491.php on line %d