3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2011-2-28'); var_dump($date->format('Y-m-d')); $date->add(new DateInterval('P1Y')); var_dump($date->format('Y-m-d')); $date2 = new DateTime('2012-2-29'); var_dump($date2->format('Y-m-d')); $date2->add(new DateInterval('P1Y')); var_dump($date2->format('Y-m-d')); $date3 = new DateTime('2013-2-28'); var_dump($date3->format('Y-m-d')); $date3->add(new DateInterval('P1Y')); var_dump($date3->format('Y-m-d'));
Output for git.master, git.master_jit, rfc.property-hooks
string(10) "2011-02-28" string(10) "2012-02-28" string(10) "2012-02-29" string(10) "2013-03-01" string(10) "2013-02-28" string(10) "2014-02-28"

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