3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time1 = new DateTime('2018-10-01 13:00:00'); $time2 = new DateTime('2018-10-01 13:59:00'); $time3 = new DateTime('2018-10-01 14:29:00'); $time4 = new DateTime('2018-10-01 15:29:00'); $part1= $time1->diff($time2)->format('%h:%i:%s'); $part2= $time2->diff($time3)->format('%h:%i:%s'); $part3= $time3->diff($time4)->format('%h:%i:%s'); $part4 = new DateTime('00:00'); $part4Clone = clone $part4; $part4->add($time1->diff($time2)); $part4->add($time2->diff($time3)); $part4 = $part4->diff($part4Clone)->format('%h:%i:%s'); var_dump($part1,$part2,$part3,$part4);
Output for git.master, git.master_jit, rfc.property-hooks
string(6) "0:59:0" string(6) "0:30:0" string(5) "1:0:0" string(6) "1:29:0"

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:
78.23 ms | 401 KiB | 8 Q