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