|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70292 Calling array_key_exists/var_dump on \DateTime adds public fields
Submitted: 2015-08-18 11:21 UTC Modified: 2015-08-18 11:47 UTC
From: orminapod3 at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: *General Issues
PHP Version: 7.0.0beta3 OS: Any
Private report: No CVE-ID: None
 [2015-08-18 11:21 UTC] orminapod3 at gmail dot com
Upon calling var_dump() or array_key_exists() on a \DateTime object, it will receive new public properties not accessible before.

Test script:
$object = new DateTime();

Expected result:
The result should be the same regardless of the arbitrary calls ( probably fields should not exist at all )

Actual result:
For the code using array_key_exists/var_dump, we receive a string from the public field.

Otherwise we receive a warning.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-18 11:47 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-08-18 11:47 UTC]
Basically, that is a duplicate of bug #69587.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Dec 05 21:05:53 2022 UTC