3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale (LC_ALL, 'pt_BR'); // Try to create the datetime instance if ($date=DateTime::createFromFormat("d-M-y",strftime("%d-%b-%y","09-mai-17"))){ echo date_format($date,"Y/m/d"); } else { // It failed! Errors found, let's figure out what! echo "<pre>"; print_r(date_get_last_errors()); echo "</pre>"; }
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Function strftime() is deprecated in /in/HRb0K on line 5 Fatal error: Uncaught TypeError: strftime(): Argument #2 ($timestamp) must be of type ?int, string given in /in/HRb0K:5 Stack trace: #0 /in/HRb0K(5): strftime('%d-%b-%y', '09-mai-17') #1 {main} thrown in /in/HRb0K on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught TypeError: strftime(): Argument #2 ($timestamp) must be of type ?int, string given in /in/HRb0K:5 Stack trace: #0 /in/HRb0K(5): strftime('%d-%b-%y', '09-mai-17') #1 {main} thrown in /in/HRb0K on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: A non well formed numeric value encountered in /in/HRb0K on line 5 1970/01/01
Output for 7.3.32 - 7.3.33
1970/01/01

preferences:
125.76 ms | 401 KiB | 168 Q