3v4l.org

run code in 300+ PHP versions simultaneously
<?php $started = DateTime::createFromFormat('Y-m-d', '2014-06-14'); $today = new DateTime(); $diff = $today->diff($started); $expired = $started->add(new DateInterval('P'.$diff->format('%m').'M')) ; // echo $diff->format('%m'); if ( $started->format('j') < $today->format('j') ) { $expired->add('P1M'); } echo $expired->format('Y-m-d');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: DateTime::add(): Argument #1 ($interval) must be of type DateInterval, string given in /in/B8tZi:12 Stack trace: #0 /in/B8tZi(12): DateTime->add('P1M') #1 {main} thrown in /in/B8tZi on line 12
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:
54.36 ms | 401 KiB | 8 Q