3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTimeImmutable('2023-11-20'); echo $date->modify('5 sundays from today')->format('Y-m-d');
Output for 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
Fatal error: Uncaught DateMalformedStringException: DateTimeImmutable::modify(): Failed to parse time string (5 sundays from today) at position 10 (f): The timezone could not be found in the database in /in/v6fEo:4 Stack trace: #0 /in/v6fEo(4): DateTimeImmutable->modify('5 sundays from ...') #1 {main} thrown in /in/v6fEo on line 4
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.1.7 - 8.1.33, 8.2.0 - 8.2.29
Warning: DateTimeImmutable::modify(): Failed to parse time string (5 sundays from today) at position 10 (f): The timezone could not be found in the database in /in/v6fEo on line 4 Fatal error: Uncaught Error: Call to a member function format() on bool in /in/v6fEo:4 Stack trace: #0 {main} thrown in /in/v6fEo on line 4
Process exited with code 255.
Output for 8.1.0 - 8.1.6
2023-12-24

preferences:
99.15 ms | 410 KiB | 5 Q