3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add_date($givendate,$day=0,$mth=0,$yr=0) { $cd = strtotime($givendate); $newdate = date('Y-m-d h:i:s', mktime(date('h',$cd), date('i',$cd), date('s',$cd), date('m',$cd)+$mth, date('d',$cd)+$day, date('Y',$cd)+$yr)); return $newdate; } $current_month_first='01'.'-'.date("m").'-'.date("Y"); $current_month_first_stamp=strtotime($current_month_first); $kezdonapszam="5"; $kezdonapszam_int= (int) $kezdonapszam; $kezdonapszam_int=$kezdonapszam_int-1; print $kezdo_full=add_date($current_month_first, $kezdonapszam_int); //if (strtotime($kezdo_full)<$current_month_first_stamp) // {$kezdo_full=add_date($kezdo_full,0,1);} print date("Y-m-d",$kezdo_full);
Output for git.master, git.master_jit, rfc.property-hooks
2014-04-05 12:00:00 Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /in/8K5oo:26 Stack trace: #0 /in/8K5oo(26): date('Y-m-d', '2014-04-05 12:0...') #1 {main} thrown in /in/8K5oo on line 26
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:
43.4 ms | 401 KiB | 8 Q