Bug #73998 [Opn->Ver]: array_key_exists fails on arrays created by get_object_vars

From: Date: Fri, 27 Jan 2017 18:48:18 +0000
Subject: Bug #73998 [Opn->Ver]: array_key_exists fails on arrays created by get_object_vars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206983@lists.php.net to get a copy of this message
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)

« previous php.bugs (#206983) next »