3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stupid_date = '1421992'; echo "strptime($stupid_date) = " . strptime($stupid_date); echo "DateTime::createFromFormat('dmY', '$stupid_date')= ". DateTime::createFromFormat('dmY', $stupid_date);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Function strptime() is deprecated in /in/s5E6t on line 5 Fatal error: Uncaught ArgumentCountError: strptime() expects exactly 2 arguments, 1 given in /in/s5E6t:5 Stack trace: #0 /in/s5E6t(5): strptime('1421992') #1 {main} thrown in /in/s5E6t on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught ArgumentCountError: strptime() expects exactly 2 arguments, 1 given in /in/s5E6t:5 Stack trace: #0 /in/s5E6t(5): strptime('1421992') #1 {main} thrown in /in/s5E6t on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: strptime() expects exactly 2 parameters, 1 given in /in/s5E6t on line 5 strptime(1421992) = Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/s5E6t:6 Stack trace: #0 {main} thrown in /in/s5E6t on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Warning: strptime() expects exactly 2 parameters, 1 given in /in/s5E6t on line 5 strptime(1421992) = Recoverable fatal error: Object of class DateTime could not be converted to string in /in/s5E6t on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: strptime() expects exactly 2 parameters, 1 given in /in/s5E6t on line 5 strptime(1421992) = Catchable fatal error: Object of class DateTime could not be converted to string in /in/s5E6t on line 6
Process exited with code 255.

preferences:
158.19 ms | 401 KiB | 212 Q