3v4l.org

run code in 300+ PHP versions simultaneously
<?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)); ?>

preferences:
50.55 ms | 402 KiB | 5 Q