|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67621 property_exists is broken
Submitted: 2014-07-15 12:10 UTC Modified: 2018-02-18 08:36 UTC
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:4 (100.0%)
From: djokodonev at gmail dot com Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 5.5.14 OS: Ubuntu 14.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: djokodonev at gmail dot com
New email:
PHP Version: OS:


 [2014-07-15 12:10 UTC] djokodonev at gmail dot com
property_exists functio is not working.

Test script:
$XML = simplexml_load_string($someRawXmlString, 'SimpleXMLElement', LIBXML_NOCDATA);
$data = json_decode(json_encode($XML));
$obj = $data;

if (property_exists($data, 'some_property')) {



The above code will not work for some weird reason. The same goes for DateTime class.


$datetime1 = new DateTime('2009-10-11');
$datetime2 = new DateTime('2009-10-13');
$interval = $datetime1->diff($datetime2);

var_dump(property_exists($interval, 'm')) //false when the property exists;



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-17 22:20 UTC]
-Status: Open +Status: Verified
 [2014-07-17 22:20 UTC]

This may be a dup.
 [2018-02-18 08:36 UTC]
-Status: Verified +Status: Duplicate
 [2018-02-18 08:36 UTC]
fixed in #69587
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC