xref: /PHP-8.1/ext/mysqli/tests/bug46614.phpt (revision b5a14e6c)
1--TEST--
2Bug #46614 (Extended MySQLi class gives incorrect empty() result)
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8if (!defined("MYSQLI_ASYNC")) {
9    die("skip mysqlnd only");
10}
11?>
12--FILE--
13<?php
14class MySQL_Ext extends mysqli{
15    protected $fooData = array();
16
17    public function isEmpty()
18    {
19        $this->extData[] = 'Bar';
20        return empty($this->extData);
21    }
22}
23
24include ("connect.inc");
25$MySQL_Ext = new MySQL_Ext($host, $user, $passwd, $db, $port, $socket);
26
27$isEmpty = $MySQL_Ext->isEmpty();
28var_dump($isEmpty);
29?>
30--EXPECT--
31bool(false)
32