Bug #67621 [Opn->Ver]: property_exists is broken

From: Date: Thu, 17 Jul 2014 22:20:18 +0000
Subject: Bug #67621 [Opn->Ver]: property_exists is broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186711@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67621&edit=1 ID: 67621 Updated by: yohgaki@php.net Reported by: djokodonev at gmail dot com Summary: property_exists is broken -Status: Open +Status: Verified Type: Bug Package: *General Issues Operating System: Ubuntu 14.04 PHP Version: 5.5.14 Block user comment: N Private report: N New Comment: http://3v4l.org/S2Ijn This may be a dup. Previous Comments: ------------------------------------------------------------------------ [2014-07-15 12:10:02] 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; ?> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67621&edit=1

« previous php.bugs (#186711) next »