1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/ext/mysqli/tests/bug33491.phpt
T
Gabriel Caruso fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00

34 lines
768 B
PHP

--TEST--
Bug #33491 (extended mysqli class crashes when result is not object)
--INI--
error_reporting=1
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
class DB extends mysqli
{
public function query_single($query) {
$result = parent::query($query);
$result->fetch_row(); // <- Here be crash
}
}
require_once("connect.inc");
// Segfault when using the DB class which extends mysqli
$DB = new DB($host, $user, $passwd, $db, $port, $socket);
$DB->query_single('SELECT DATE()');
?>
--EXPECTF--
Fatal error: Uncaught Error: Call to a member function fetch_row() on bool in %sbug33491.php:%d
Stack trace:
#0 %s(%d): DB->query_single('SELECT DATE()')
#1 {main}
thrown in %sbug33491.php on line %d