3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2017-06-28'); var_dump($date->format('Y-m-d')); $test = floor(1 / 3); var_dump($test); $date->setDate($date->format('Y'), floor(($date->format('m')-1) / 3) * 3 + 1, 1); var_dump($date->format('Y-m-d')); $date = clone($date); $date->modify('+3 month -1 day'); var_dump($date->format('Y-m-d')); $date->setDate($date->format('Y'), 1, 1); var_dump($date->format('Y-m-d')); $date->setDate($date->format('Y'), 12, 31); var_dump($date->format('Y-m-d'));
Output for git.master, git.master_jit, rfc.property-hooks
string(10) "2017-06-28" float(0) string(10) "2017-04-01" string(10) "2017-06-30" string(10) "2017-01-01" string(10) "2017-12-31"

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