Extended MySQLi class gives incorrect empty() result (works in PHP_5_2 !)
| Bug #46614 | Extended MySQLi class gives incorrect empty() result (works in PHP_5_2 !) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2008-11-19 13:25 UTC | Modified: | 2009-08-27 12:42 UTC |
|
||||||
| From: | sander dot vink at procurios dot nl | Assigned: | mysql (profile) | |||||||
| Status: | Closed | Package: | MySQLi related | |||||||
| PHP Version: | 5.3CVS-2008-11-19 (snap) | OS: | * | |||||||
| Private report: | No | CVE-ID: | None | |||||||
[2008-11-19 13:25 UTC] sander dot vink at procurios dot nl
Description:
------------
When an empty() call is done within a class that extends the MySQLi class, an incorrect result is provided.
Reproduce code:
---------------
class Foo extends MySQLi
{
protected $fooData = array();
public function isEmpty()
{
$this->fooData[] = 'Bar';
return empty($this->fooData);
}
}
$Foo = new Foo('localhost', 'root', '', 'test');
$isEmpty = $Foo->isEmpty();
var_dump($isEmpty);
Expected result:
----------------
bool(false)
Actual result:
--------------
bool(true)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-11-19 23:12 UTC] jani@php.net
[2008-11-20 08:14 UTC] sander dot vink at procurios dot nl
[2008-11-21 13:05 UTC] jani@php.net
[2009-08-27 12:42 UTC] andrey@php.net