Bug #73998 [Opn->Ver]: array_key_exists fails on arrays created by get_object_vars
Edit report at https://bugs.php.net/bug.php?id=73998&edit=1
ID: 73998
Updated by: cmb@php.net
Reported by: Hauke dot Jensen at volz-software dot de
Summary: array_key_exists fails on arrays created by
get_object_vars
-Status: Open
+Status: Verified
Type: Bug
Package: Arrays related
Operating System: Linux
-PHP Version: 7.1.1
+PHP Version: 7.0.0
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/vZbPc>.
Previous Comments:
------------------------------------------------------------------------
[2017-01-25 19:05:53] Hauke dot Jensen at volz-software dot de
Description:
------------
array_key_exists fails on arrays created by get_object_vars on Objects with numeric Propertie Names.
It works fine in the old PHP 5.3 enviroment.
Test script:
---------------
$json = '{"100308":1}';
$temp = json_decode($json);
$sub = get_object_vars($temp); // Error Array
var_dump($sub, array_key_exists('100308', $sub));
Expected result:
----------------
array(1) {
[100308]=>
int(1)
}
bool(true)
Actual result:
--------------
array(1) {
["100308"]=>
int(1)
}
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73998&edit=1
Thread (5 messages)