3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $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", '_');
Output for 7.1.0
Properties: start current end interval recurrences include_start_date Methods: __construct __wakeup __set_state getStartDate getEndDate getDateInterval Array cast: Array ( [start] => DateTime Object ( [date] => 2010-01-01 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [current] => [end] => [interval] => DateInterval Object ( [y] => 0 [m] => 0 [d] => 1 [h] => 0 [i] => 0 [s] => 0 [f] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) [recurrences] => 3 [include_start_date] => 1 )
Output for 5.6.5 - 7.0.14
Properties: start current end interval recurrences include_start_date Methods: __construct __wakeup __set_state getStartDate getEndDate getDateInterval Array cast: Array ( [start] => DateTime Object ( [date] => 2010-01-01 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [current] => [end] => [interval] => DateInterval Object ( [y] => 0 [m] => 0 [d] => 1 [h] => 0 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) [recurrences] => 3 [include_start_date] => 1 )
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.4
Properties: start current end interval recurrences include_start_date Methods: __construct __wakeup __set_state Array cast: Array ( [start] => DateTime Object ( [date] => 2010-01-01 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [current] => [end] => [interval] => DateInterval Object ( [y] => 0 [m] => 0 [d] => 1 [h] => 0 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) [recurrences] => 3 [include_start_date] => 1 )
Output for 5.3.27 - 5.3.29, 5.4.17 - 5.4.29, 5.5.0 - 5.5.13
Properties: start current end interval recurrences include_start_date Methods: __construct __wakeup __set_state Array cast: Array ( [start] => DateTime Object ( [date] => 2010-01-01 00:00:00 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) [current] => [end] => [interval] => DateInterval Object ( [y] => 0 [m] => 0 [d] => 1 [h] => 0 [i] => 0 [s] => 0 [weekday] => 0 [weekday_behavior] => 0 [first_last_day_of] => 0 [invert] => 0 [days] => [special_type] => 0 [special_amount] => 0 [have_weekday_relative] => 0 [have_special_relative] => 0 ) [recurrences] => 3 [include_start_date] => 1 )
Output for 5.3.0 - 5.3.26, 5.4.0 - 5.4.16
Properties: Methods: __construct Array cast: Array ( )
Output for 5.0.0 - 5.2.17
Fatal error: Class 'DatePeriod' not found in /in/r0mFG on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: dateperiod in /in/r0mFG on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: dateperiod in /in/r0mFG on line 3