3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dates = array ('24-12-2013', '25-12-2013', '26-12-2014', '27-12-2013'); $start = strtotime('25-12-2013'); $end = strtotime('26-12-2013'); $inDateRange = count( array_filter( $dates, function($value,$start, $end) { $value = strtotime($value); return ($value >= $start && $value <= $end); } ) );
based on GbttS
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 3 expected in /in/RVONO:10 Stack trace: #0 [internal function]: {closure}('24-12-2013') #1 /in/RVONO(13): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/RVONO on line 10
Process exited with code 255.
Output for 5.3.20 - 7.0.20
Warning: Missing argument 2 for {closure}() in /in/RVONO on line 10 Warning: Missing argument 3 for {closure}() in /in/RVONO on line 10 Notice: Undefined variable: start in /in/RVONO on line 12 Notice: Undefined variable: end in /in/RVONO on line 12 Warning: Missing argument 2 for {closure}() in /in/RVONO on line 10 Warning: Missing argument 3 for {closure}() in /in/RVONO on line 10 Notice: Undefined variable: start in /in/RVONO on line 12 Notice: Undefined variable: end in /in/RVONO on line 12 Warning: Missing argument 2 for {closure}() in /in/RVONO on line 10 Warning: Missing argument 3 for {closure}() in /in/RVONO on line 10 Notice: Undefined variable: start in /in/RVONO on line 12 Notice: Undefined variable: end in /in/RVONO on line 12 Warning: Missing argument 2 for {closure}() in /in/RVONO on line 10 Warning: Missing argument 3 for {closure}() in /in/RVONO on line 10 Notice: Undefined variable: start in /in/RVONO on line 12 Notice: Undefined variable: end in /in/RVONO on line 12