Bug #67067 [Opn->Dup]: isset() and empty() on NULL value of the ArrayObject child class
Edit report at https://bugs.php.net/bug.php?id=67067&edit=1
ID: 67067
Updated by: levim@php.net
Reported by: dmitriy dot trt at gmail dot com
Summary: isset() and empty() on NULL value of the ArrayObject
child class
-Status: Open
+Status: Duplicate
Type: Bug
Package: *General Issues
Operating System: Windows 7 x86, Linux
PHP Version: 5.4.27
Block user comment: N
Private report: N
New Comment:
Closing as a duplicate of bug 66834.
Previous Comments:
------------------------------------------------------------------------
[2014-04-13 19:21:38] dmitriy dot trt at gmail dot com
Description:
------------
ArrayObject itself and child classes work fine until you override offsetExists() method, even with a
method returning parent's results. Both isset() and empty() return incorrect results on NULL
value set to the pseudo-array.
Reproducible on PHP 5.4.27, Windows 7 x86.
Test script:
---------------
http://pastebin.com/geNadPSA
Expected result:
----------------
array(2) {
["ArrayObject"]=>
array(2) {
["empty"]=>
bool(true)
["isset"]=>
bool(false)
}
["ArrayObjectOverride"]=>
array(2) {
["empty"]=>
bool(true)
["isset"]=>
bool(false)
}
}
Actual result:
--------------
array(2) {
["ArrayObject"]=>
array(2) {
["empty"]=>
bool(true)
["isset"]=>
bool(false)
}
["ArrayObjectOverride"]=>
array(2) {
["empty"]=>
bool(false)
["isset"]=>
bool(true)
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67067&edit=1
Thread (2 messages)