3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $update_flag = 0; $row_avail = array( 'field_windows_value' => '2014-09-18T00:00:00', 'field_windows_value2' => '2015-09-30T00:00:00' ); if ( $row_avail['field_windows_value'] != $row_avail['field_windows_value2'] ) { if ( strtotime($row_avail['field_windows_value']) < time() && time() <= strtotime($row_avail['field_windows_value2']) ) { $update_flag = 1; } } else { if ( strtotime($row_avail['field_windows_value']) < time() && $row_avail['field_windows_value'] != NULL ) { $update_flag = 1; } } print $update_flag."\n"; $update_flag = 0; $last_start = 0; if ( $row_avail['field_windows_value'] != $row_avail['field_windows_value2'] ) { if ( strtotime($row_avail['field_windows_value2']) < time() ) { if ( $last_start != 0 && $last_start > time() ) { $update_flag = 1; break; } elseif ( $last_start == 0 ) { $update_flag = 1; break; } } } else { if ( strtotime($row_avail['field_windows_value2']) > time() && $row_avail['field_windows_value'] != NULL ) { $update_flag = 1; break; } } $last_start = $row_avail['field_windows_value']; print $update_flag."\n"; print $last_start."\n"; $avail_result = array ( array ( 'field_availability_block_start_date' => '2014-09-18 00:00:00', 'field_availability_block_end_date' => '2015-09-30 00:00:00', ), array ( 'field_availability_block_start_date' => '2015-09-30 00:00:00', 'field_availability_block_end_date' => '2015-09-30 00:00:00', ), ); foreach ( $avail_result AS $row_avail ) { if ( $row_avail['field_availability_block_start_date'] != $row_avail['field_availability_block_end_date'] ) { if ( strtotime($row_avail['field_availability_block_end_date']) < time() ) { if ( $last_start != 0 && $last_start > time() ) { $update_flag = 1; break; } elseif ( $last_start == 0 ) { $update_flag = 1; break; } } } else { if ( strtotime($row_avail['field_availability_block_end_date']) > time() && $row_avail['field_availability_block_start_date'] != NULL ) { $update_flag = 1; break; } } $last_start = $row_avail['field_availability_block_start_date']; } print $update_flag."\n"; print $last_start."\n";
based on 0luZZ
Output for 5.4.0 - 5.6.28
1 0 2014-09-18T00:00:00 1 2014-09-18 00:00:00