|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-17 22:20 UTC] yohgaki@php.net
-Status: Open
+Status: Verified
[2014-07-17 22:20 UTC] yohgaki@php.net
[2018-02-18 08:36 UTC] jhdxr@php.net
-Status: Verified
+Status: Duplicate
[2018-02-18 08:36 UTC] jhdxr@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 14:00:01 2025 UTC |
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; ?>