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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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 12:00:01 2026 UTC