3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateinterval = new DateInterval('PT1H'); print_r($dateinterval); echo "\n"; echo json_encode($dateinterval); echo "\n"; $string = $dateinterval->format('%y years %m months %d days %h hours %i minutes %s seconds'); echo $string; echo "\n"; $dateinterval2 = DateInterval::createFromDateString($string); $string2 = $dateinterval2->format('%y years %m months %d days %h hours %i minutes %s seconds'); echo $string;
Output for git.master, git.master_jit, rfc.property-hooks
DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 1 [i] => 0 [s] => 0 [f] => 0 [invert] => 0 [days] => [from_string] => ) {"y":0,"m":0,"d":0,"h":1,"i":0,"s":0,"f":0,"invert":0,"days":false,"from_string":false} 0 years 0 months 0 days 1 hours 0 minutes 0 seconds 0 years 0 months 0 days 1 hours 0 minutes 0 seconds

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:
38.05 ms | 402 KiB | 8 Q