3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = new DateTime('2011-01-15 00:00:00'); //$d = mktime(0, 0, 0, 1, 15, 2011); $foo = strtotime('-1 month', $d); $current_day = date('d', $foo); $num_days = date('t', $foo); $day_offset = $num_days - $current_day; //echo "\n " . $day_offset . "\n"; //foo = strtotime('1 day', $foo); $foo = strtotime(''.$day_offset .' day', $foo); echo "\n Date: " . date("Y-m-d h:i:sa", $foo) . "\n"; //$d = $d->modify('-1 month'); //$d = $d->modify('' . $day_offset . ' day'); //var_dump($d);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: strtotime(): Argument #2 ($baseTimestamp) must be of type ?int, DateTime given in /in/WMTVN:6 Stack trace: #0 /in/WMTVN(6): strtotime('-1 month', Object(DateTime)) #1 {main} thrown in /in/WMTVN on line 6
Process exited with code 255.

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