3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = '2017-2-1'; $start = \DateTimeImmutable::createFromFormat('Y-m-d', $n); $end = $start->modify('1 month - 1 second'); $b = new \DateTime('2017-4-12'); var_dump($start->getTimestamp()); var_dump($end->getTimestamp()); var_dump($start->format('Y.M.d')); var_dump($end->format('Y.M.d')); var_dump($end->diff($b));
Output for git.master, git.master_jit, rfc.property-hooks
int(1485963140) int(1488382339) string(11) "2017.Feb.01" string(11) "2017.Mar.01" object(DateInterval)#4 (10) { ["y"]=> int(0) ["m"]=> int(1) ["d"]=> int(10) ["h"]=> int(7) ["i"]=> int(27) ["s"]=> int(41) ["f"]=> float(0) ["invert"]=> int(0) ["days"]=> int(41) ["from_string"]=> bool(false) }

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.47 ms | 405 KiB | 9 Q