3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data['ealkalom'] = '2014. 04. 30. 00:00'; $data['valkalom'] = '2014. 04. 30. 00:00'; function checkInvalidHour($date) { var $hour = ""; if(preg_match("/(2[0-3]|[01][0-9]):[0-5][0-9]/", $date, $match)) { list($hour, $min) = explode(":", $match[0]); } return $hour; } if(checkInvalidHour($data['ealkalom']) == "00" or checkInvalidHour($data['valkalom']) == "00") { $dateType = "Y. m. d."; } else { $dateType = "Y. m. d. H:i"; } print $data['ealkalom'] = date($dateType, $data['ealkalom']); print $data['valkalom'] = date($dateType, $data['valkalom']);
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'var' (T_VAR) in /in/gkPag on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VAR in /in/gkPag on line 7
Process exited with code 255.