3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ref = new DateTime('2024-01-01 00:00:00', new DateTimeZone('Europe/Berlin')); $t1 = new DateTime('2024-03-31 12:00:00', new DateTimeZone('Europe/Berlin')); $t2 = new DateTime('2024-04-01 12:00:00', new DateTimeZone('Europe/Berlin')); $t3 = new DateTime('2024-10-27 12:00:00', new DateTimeZone('Europe/Berlin')); $t4 = new DateTime('2024-10-28 12:00:00', new DateTimeZone('Europe/Berlin')); // DST start $diff1 = $ref->diff($t1); $diff2 = $ref->diff($t2); // DST end $diff3 = $ref->diff($t3); $diff4 = $ref->diff($t4); echo('DST start' . PHP_EOL); var_dump($diff1->h, $diff2->h); echo('DST end' . PHP_EOL); var_dump($diff3->h, $diff4->h);
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
DST start int(11) int(12) DST end int(12) int(12)
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.

preferences:
78.89 ms | 407 KiB | 5 Q