Bug #73998 [Csd]: array_key_exists fails on arrays created by get_object_vars

From: Date: Fri, 17 Mar 2017 16:35:13 +0000
Subject: Bug #73998 [Csd]: 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-207898@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: ajf@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: Closed Type: Bug Package: Arrays related Operating System: Linux PHP Version: 7.0.0 Assigned To: nikic Block user comment: N Private report: N New Comment: Uhm: https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts Did we just backport an RFC-agreed change from 7.2 to a 7.1 patch release? Previous Comments: ------------------------------------------------------------------------ [2017-02-02 17:43:24] nikic@php.net Fixed by http://git.php.net/?p=php-src.git;a=commitdiff;h=dd9cf23457e21d2bda29dc92d437b9dbd14027b2. ------------------------------------------------------------------------ [2017-01-27 18:48:17] cmb@php.net Confirmed: <https://3v4l.org/vZbPc>. ------------------------------------------------------------------------ [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

« previous php.bugs (#207898) next »