php.net |  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: 2014-07-17 22:20 UTC
Votes:4
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: Verified Package: *General Issues
PHP Version: 5.5.14 OS: Ubuntu 14.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

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



Test script:
---------------
<?php
$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.

<?php

$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;

?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-17 22:20 UTC] yohgaki@php.net
-Status: Open +Status: Verified
 [2014-07-17 22:20 UTC] yohgaki@php.net
http://3v4l.org/S2Ijn

This may be a dup.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC