|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-12-03 02:27 UTC] cataphract@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: cataphract
[2011-01-09 06:00 UTC] cataphract@php.net
-Assigned To: cataphract
+Assigned To: derick
[2011-01-09 06:00 UTC] cataphract@php.net
[2011-01-22 09:11 UTC] stas@php.net
-Type: Bug
+Type: Feature/Change Request
[2012-05-30 19:15 UTC] krebs dot seb at googlemail dot com
[2012-08-30 09:30 UTC] rdohms@php.net
[2014-02-06 13:51 UTC] arjen at react dot com
[2017-03-24 06:47 UTC] heiglandreas@php.net
-Status: Assigned
+Status: Not a bug
[2017-03-24 06:47 UTC] heiglandreas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
Description: ------------ The DatePeriod instance does not expose its internal properties, thus makes impossible to extend the class. The properties are not visible in the reflection as well. Also, when I cast the instance to array (which usually exposes all properties), no props are shown. The draft of the test follows. Test script: --------------- $dp = new DatePeriod(new DateTime('2010-01-01'), new DateInterval('P1D'), 2); $r = new ReflectionObject($dp); $arr = (array)$dp; // cast to array to see the values of propeties echo "Properties:\r\n"; foreach($r->getProperties() as $v) { echo $v->getName()."\r\n"; } echo "\r\n"; echo "Methods:\r\n"; foreach($r->getMethods() as $v) { echo $v->getName()."\r\n"; } echo "\r\n"; echo "Array cast:\r\n"; echo strtr(print_r($arr, true), "\0", '_'); Expected result: ---------------- Properties: any_valid_properties... ...listed_here_after_implementing Array cast: Array ( any_valid_properties... ...listed_here_after_implementing ) Actual result: -------------- Properties: Array cast: Array ( )