3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '20230121'; $date_from_format = DateTime::createFromFormat('Ymd', $date, new DateTimeZone('Asia/Jerusalem')); print_r([ $date->format('j'), $date->format('F'), $date->format('Y'), ]);
Output for 8.0.1 - 8.0.27, 8.1.0 - 8.1.14, 8.2.0 - 8.2.1
Fatal error: Uncaught Error: Call to a member function format() on string in /in/P9a0d:8 Stack trace: #0 {main} thrown in /in/P9a0d on line 8
Process exited with code 255.

preferences:
17.32 ms | 406 KiB | 5 Q