3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function validBirthDate($fecha,$arrData,$params){ if (isset($arrData['fecha_nacimiento'])) { $month = isset($arrData['mes']) && is_numeric($arrData['mes']) && !strstr($arrData['mes'], '.') ? (int)$arrData['mes'] : 0; $day = isset($arrData['dia']) && is_numeric($arrData['dia']) && !strstr($arrData['dia'], '.') ? (int)$arrData['dia'] : 0; $year = isset($arrData['anio']) && is_numeric($arrData['anio']) && !strstr($arrData['anio'], '.') ? (int)$arrData['anio'] : 0; return checkdate($month, $day, $year); }else{ return false; } } echo validBirthDate('', array('fecha_nacimiento'=>'123', 'mes'=>'1', 'dia'=>'1', 'anio'=>'1', false)) ? 'valid' : 'invalid';
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function validBirthDate(), 2 passed in /in/l0u7I on line 16 and exactly 3 expected in /in/l0u7I:2 Stack trace: #0 /in/l0u7I(16): validBirthDate('', Array) #1 {main} thrown in /in/l0u7I on line 2
Process exited with code 255.
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.0.14
Warning: Missing argument 3 for validBirthDate(), called in /in/l0u7I on line 16 and defined in /in/l0u7I on line 2 valid
Output for hhvm-3.10.0 - 3.12.0
Warning: validBirthDate() expects exactly 3 parameters, 2 given in /in/l0u7I on line 3 valid
Output for 5.0.0 - 5.0.5
Warning: Missing argument 3 for validBirthDate() in /in/l0u7I on line 2 valid
Output for 4.3.0 - 4.4.9
Warning: Missing argument 3 for validbirthdate() in /in/l0u7I on line 2 valid