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; } 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 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2014-04-01,,,1396303200...1398074400 Fatal error: Uncaught ArgumentCountError: date() expects at least 1 argument, 0 given in /in/iXQPc:25 Stack trace: #0 /in/iXQPc(25): date() #1 {main} thrown in /in/iXQPc on line 25
Process exited with code 255.
Output for 8.0.13
2014-04-01,,,1396310400...1398081600 Fatal error: Uncaught ArgumentCountError: date() expects at least 1 argument, 0 given in /in/iXQPc:25 Stack trace: #0 /in/iXQPc(25): date() #1 {main} thrown in /in/iXQPc on line 25
Process exited with code 255.
Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.33
2014-04-01,,,1396303200...1398074400 Warning: date() expects at least 1 parameter, 0 given in /in/iXQPc on line 25 ...2014-04-21 12:00:00
Output for 7.3.32 - 7.3.33
2014-04-01,,,1396310400...1398081600 Warning: date() expects at least 1 parameter, 0 given in /in/iXQPc on line 25 ...2014-04-21 12:00:00
Output for 5.1.1
2014-04-01,,,1396303200...1398074400 Warning: date() expects at least 1 parameter, 0 given in /in/iXQPc on line 25 ...2014-05-21 12:00:00
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/iXQPc on line 30
Process exited with code 255.
Output for 5.0.1 - 5.0.5
2014-04-01,,,1396303200...1398074400 Warning: Wrong parameter count for date() in /in/iXQPc on line 25 Warning: strtotime(): Called with an empty time parameter. in /in/iXQPc on line 25 ...2014-04-21 12:00:00
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0
2014-04-01,,,1396303200...1398074400 Warning: Wrong parameter count for date() in /in/iXQPc on line 25 Notice: strtotime(): Called with empty time parameter in /in/iXQPc on line 25 ...2014-05-21 12:00:00
Output for 4.3.0 - 4.3.1
2014-04-01,,,1396303200...1398074400 Warning: Wrong parameter count for date() in /in/iXQPc on line 25 Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/iXQPc on line 25 ...2014-05-21 12:00:00

preferences:
200.3 ms | 402 KiB | 356 Q