|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2020 The PHP Group
All rights reserved.
Last updated: Mon Jul 13 05:01:26 2020 UTC