3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $da = array("sunday","thursday","saturday"); $a = ''; for ( $i =0; $i< sizeof($da); $i++){ if ( $da[0] == 'sunday' && sizeof($da) > 1 && (strtotime('today') != strtotime($da[0])) ){ continue; } if ( strtotime($da[$i]) >= strtotime("today") ){ $a = strtotime($da[$i]); if (isset($a)){ break; } } } print_r(date('Y-m-d',$a)); ?>
based on igah4
Output for 7.0.0 - 7.2.0
Warning: date() expects parameter 2 to be integer, string given in /in/eVW80 on line 18
Output for 5.5.0 - 5.6.28
Warning: date() expects parameter 2 to be long, string given in /in/eVW80 on line 18