3v4l.org

run code in 300+ PHP versions simultaneously
<?php rec['birthday'] = '3/11'; $date = explode('/', $rec['birthday']); if(!isset($date[2])){ $new_date = $date[0].'-'.$date[1].'-'.'0000'; } else{ $new_date = $date[0].'-'.$date[1].'-'.$date[2]; } echo $new_date;
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '[' in /in/XYRmX on line 2
Process exited with code 255.

preferences:
170.96 ms | 1395 KiB | 62 Q