3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array("400 seconds", "400.1 seconds", "400.12 seconds", "400.123 seconds"); foreach ($tests as $index => $test) { var_dump(DateInterval->createFromDateString($test)->format("%Hh, %im, %ss")); var_dump(parse_date($test)); }
Output for 8.1.23 - 8.1.27, 8.2.10 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Undefined constant "DateInterval" in /in/jbB7k:5 Stack trace: #0 {main} thrown in /in/jbB7k on line 5
Process exited with code 255.
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/jbB7k on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/jbB7k on line 5
Process exited with code 255.

preferences:
87.34 ms | 401 KiB | 81 Q