3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $one_year_ago = date('Y-m-d 0:00', strtotime("-1 year", time())); $retry_after_date = new DateTime($one_year_ago); echo 'start::'.$retry_after_date->format('Y-m-d H:i'); for ($i=5; $i < 50; $i+=5) { // $retry_after_date = DateAdd("n", 5, RetryAfterDate) $retry_after_date->add(new DateInterval('PT 5 M')); echo "\n$i::".$retry_after_date->format('Y-m-d H:i'); }

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
start::2013-03-12 00:00 Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (PT 5 M) in /in/tdaGt:8 Stack trace: #0 /in/tdaGt(8): DateInterval->__construct('PT 5 M') #1 {main} thrown in /in/tdaGt on line 8
Output for Array change keys
start::2013-03-12 00:00 Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format (PT 5 M) in /in/tdaGt:8 Stack trace: #0 /in/tdaGt(8): DateInterval->__construct('PT 5 M') #1 {main} thrown in /in/tdaGt on line 8
Output for Lexical anon
start::2013-03-12 00:00 Fatal error: Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (PT 5 M)' in /in/tdaGt:8 Stack trace: #0 /in/tdaGt(8): DateInterval->__construct('PT 5 M') #1 {main} thrown in /in/tdaGt on line 8

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