3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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; } print $current_month_first=date("Y").'-'.date("m").'-'.'01'; print ',,,'.$current_month_first_stamp=strtotime($current_month_first); $kezdonapszam="21"; $kezdonapszam_int= (int) $kezdonapszam; $kezdonapszam_int=$kezdonapszam_int-1; $kezdo_full=add_date($current_month_first, $kezdonapszam_int); print '...'.strtotime($kezdo_full); if (strtotime($kezdo_full)<strtotime($date())) {$kezdo_full=add_date($kezdo_full,0,1);} print '...'.$kezdo_full; //print date("Y-m-d",$kezdo_full);
Output for 7.0.0 - 7.1.0
2014-04-01,,,1396303200...1398074400 Notice: Undefined variable: date in /in/V3FP7 on line 25 Fatal error: Uncaught Error: Function name must be a string in /in/V3FP7:25 Stack trace: #0 {main} thrown in /in/V3FP7 on line 25
Process exited with code 255.
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.6.28
2014-04-01,,,1396303200...1398074400 Notice: Undefined variable: date in /in/V3FP7 on line 25 Fatal error: Function name must be a string in /in/V3FP7 on line 25
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/V3FP7 on line 30
Process exited with code 255.
Output for 5.0.0 - 5.0.3
2014-04-01,,,1396303200...1398074400 Notice: Undefined variable: date in /in/V3FP7 on line 25 Fatal error: Function name must be a string in /in/V3FP7 on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
2014-04-01,,,1396303200...1398074400 Notice: Undefined variable: date in /in/V3FP7 on line 25 Fatal error: Call to undefined function: () in /in/V3FP7 on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.4
2014-04-01,,,1396303200...1398074400 Notice: Undefined variable: date in /in/V3FP7 on line 25 Fatal error: Call to undefined function: () in /in/V3FP7 on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
2014-04-01,,,1396303200...1398074400 Notice: Undefined variable: date in /in/V3FP7 on line 25 Fatal error: Call to undefined function: () in /in/V3FP7 on line 25