3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //echo date('d-M-y'); //echo date('d-m-y H:i:s A' , strtotime( '29-APR-13 09.28.12.505032 pm')); $date = '29-APR-13 09.28.12.505032 PM'; $new_date = substr($date,0,18).substr($date, 25,28); $new_date = str_replace(".", ":", $new_date); //echo $new_date; //echo "\n"; $oracle_date = date('d/m/y H:i:s', strtotime($new_date)); echo $oracle_date; echo "\n"; $current_date = date("d/m/y H:i:s"); //$elapsed_time = round(abs(date("d/m/y H:i:s") - $oracle_date) / 60,2); //echo "\n"; //echo $elapsed_time; $interval = date_diff($current_date, $oracle_date); echo $interval->format('%I minutos');
Output for 7.0.0 - 7.1.0
29/04/13 21:28:12 Warning: date_diff() expects parameter 1 to be DateTimeInterface, string given in /in/Ztap1 on line 17 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/Ztap1:18 Stack trace: #0 {main} thrown in /in/Ztap1 on line 18
Process exited with code 255.
Output for hhvm-3.12.0
29/04/13 21:28:12 Fatal error: Uncaught TypeError: Argument 1 passed to date_diff() must implement interface DateTimeInterface, string given in /in/Ztap1:17 Stack trace: #0 /in/Ztap1(17): date_diff() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
29/04/13 21:28:12 Catchable fatal error: Argument 1 passed to date_diff() must implement interface DateTimeInterface, string given in /in/Ztap1 on line 17
Process exited with code 255.
Output for 5.6.0 - 5.6.28
29/04/13 21:28:12 Warning: date_diff() expects parameter 1 to be DateTimeInterface, string given in /in/Ztap1 on line 17 Fatal error: Call to a member function format() on boolean in /in/Ztap1 on line 18
Process exited with code 255.
Output for 5.5.8 - 5.5.38
29/04/13 21:28:12 Warning: date_diff() expects parameter 1 to be DateTimeInterface, string given in /in/Ztap1 on line 17 Fatal error: Call to a member function format() on a non-object in /in/Ztap1 on line 18
Process exited with code 255.
Output for 5.3.0 - 5.5.7
29/04/13 21:28:12 Warning: date_diff() expects parameter 1 to be DateTime, string given in /in/Ztap1 on line 17 Fatal error: Call to a member function format() on a non-object in /in/Ztap1 on line 18
Process exited with code 255.
Output for 5.0.0 - 5.2.17
29/04/13 21:28:12 Fatal error: Call to undefined function date_diff() in /in/Ztap1 on line 17
Process exited with code 255.
Output for 4.4.5 - 4.4.9
29/04/13 21:28:12 Fatal error: Call to undefined function: date_diff() in /in/Ztap1 on line 17
Process exited with code 255.
Output for 4.3.2 - 4.4.4
29/04/13 21:28:12 Fatal error: Call to undefined function: date_diff() in /in/Ztap1 on line 17
Process exited with code 255.
Output for 4.3.0 - 4.3.1
29/04/13 21:28:12 Fatal error: Call to undefined function: date_diff() in /in/Ztap1 on line 17