3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass extends DateTimeImmutable{} $interval = new DatePeriod( new TestClass(), new DateInterval('P1D'), new TestClass('+5 days'), ); var_dump( $interval, ...$interval );
Output for git.master_jit
object(DatePeriod)#1 (7) { ["start"]=> object(TestClass)#4 (3) { ["date"]=> string(26) "2025-04-27 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ["current"]=> object(TestClass)#9 (3) { ["date"]=> string(26) "2025-05-03 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ["end"]=> object(TestClass)#10 (3) { ["date"]=> string(26) "2025-05-02 16:15:57.040236" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ["interval"]=> object(DateInterval)#11 (10) { ["y"]=> int(0) ["m"]=> int(0) ["d"]=> int(1) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["invert"]=> int(0) ["days"]=> bool(false) ["from_string"]=> bool(false) } ["recurrences"]=> int(1) ["include_start_date"]=> bool(true) ["include_end_date"]=> bool(false) } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2025-04-27 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2025-04-28 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2025-04-29 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#6 (3) { ["date"]=> string(26) "2025-04-30 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#7 (3) { ["date"]=> string(26) "2025-05-01 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#8 (3) { ["date"]=> string(26) "2025-05-02 16:15:57.040222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for git.master
object(DatePeriod)#1 (7) { ["start"]=> object(TestClass)#4 (3) { ["date"]=> string(26) "2025-04-27 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ["current"]=> object(TestClass)#9 (3) { ["date"]=> string(26) "2025-05-03 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ["end"]=> object(TestClass)#10 (3) { ["date"]=> string(26) "2025-05-02 16:15:57.010607" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ["interval"]=> object(DateInterval)#11 (10) { ["y"]=> int(0) ["m"]=> int(0) ["d"]=> int(1) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(0) ["invert"]=> int(0) ["days"]=> bool(false) ["from_string"]=> bool(false) } ["recurrences"]=> int(1) ["include_start_date"]=> bool(true) ["include_end_date"]=> bool(false) } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2025-04-27 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2025-04-28 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#5 (3) { ["date"]=> string(26) "2025-04-29 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#6 (3) { ["date"]=> string(26) "2025-04-30 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#7 (3) { ["date"]=> string(26) "2025-05-01 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#8 (3) { ["date"]=> string(26) "2025-05-02 16:15:57.010595" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.97 ms | 419 KiB | 5 Q