php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73914 get_object_vars issue
Submitted: 2017-01-11 17:58 UTC Modified: 2017-01-11 21:03 UTC
From: johncitak at gmail dot com Assigned: nikic (profile)
Status: Closed Package: *General Issues
PHP Version: 7.1.0 OS: linux debian jessie
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: johncitak at gmail dot com
New email:
PHP Version: OS:

 

 [2017-01-11 17:58 UTC] johncitak at gmail dot com
Description:
------------
get_object_vars returned array is not accessible by its keys. 

Test script:
---------------
$obj = new stdClass();
$obj->{"1"} = 1;
$obj->{"2"} = 2;
$vars = get_object_vars($obj);
var_dump(isset($vars[1]));

Expected result:
----------------
TRUE

Actual result:
--------------
FALSE

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-11 21:03 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2017-01-11 21:03 UTC] nikic@php.net
Will be fixed in PHP 7.2 as part of https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 10:00:01 2026 UTC