3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time_intervals = preg_split('/[\;]+/', $time_intervals); //separates the intervals by ; $time_valid = false; $i = 0; $time_to_check = strtotime(date('H:i', strtotime($time_to_check))); foreach ($time_intervals as $time_interval): $time = preg_split('/[\-]+/', $time_interval); if (($time_to_check >= strtotime($time[0])) && ($time_to_check <= strtotime($time[1]))): $time_valid = true; endif; endforeach; ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Notice: Undefined offset: 1 in /in/8beWe on line 12
Output for hhvm-3.12.0
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Warning: preg_split() expects parameter 2 to be string, null given in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Warning: strtotime() expects parameter 1 to be string, null given in /in/8beWe on line 7 Warning: Invalid argument supplied for foreach() in /in/8beWe on line 18
Output for hhvm-3.10.0
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Notice: Undefined index: 1 in /in/8beWe on line 12
Output for 5.1.2 - 5.2.17
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Notice: Undefined offset: 1 in /in/8beWe on line 12
Output for 5.1.0 - 5.1.1
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Warning: strtotime(): Called with an empty time parameter. in /in/8beWe on line 7 Warning: strtotime(): Called with an empty time parameter. in /in/8beWe on line 12 Notice: Undefined offset: 1 in /in/8beWe on line 12 Warning: strtotime(): Called with an empty time parameter. in /in/8beWe on line 12
Output for 5.0.1 - 5.0.3
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Warning: strtotime(): Called with an empty time parameter. in /in/8beWe on line 7 Warning: strtotime(): Called with an empty time parameter. in /in/8beWe on line 12 Notice: Undefined offset: 1 in /in/8beWe on line 12 Warning: strtotime(): Called with an empty time parameter. in /in/8beWe on line 12
Output for 4.3.2 - 5.0.0
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Notice: strtotime(): Called with empty time parameter in /in/8beWe on line 7 Notice: strtotime(): Called with empty time parameter in /in/8beWe on line 12 Notice: Undefined offset: 1 in /in/8beWe on line 12 Notice: strtotime(): Called with empty time parameter in /in/8beWe on line 12
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: time_intervals in /in/8beWe on line 3 Notice: Undefined variable: time_to_check in /in/8beWe on line 7 Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/8beWe on line 7 Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/8beWe on line 12 Notice: Undefined offset: 1 in /in/8beWe on line 12 Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/8beWe on line 12