3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(new DateTime('now', new DateTimeZone('Etc/GMT+1')));
Output for 8.5.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007416" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.5.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010931" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
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.4.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010758" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004077" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009782" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009080" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010052" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.005193" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009829" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010311" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010465" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.011242" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010217" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009898" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010341" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.4.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004467" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.011276" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009580" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009374" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004186" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007717" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007864" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003853" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009224" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004235" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009137" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009201" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.008885" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.005161" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.008842" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009882" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003609" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.008923" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003630" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004039" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.006404" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004201" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007081" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007526" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010088" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.006788" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.006903" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003632" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003688" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004136" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003787" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009389" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009365" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003652" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004094" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004091" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003951" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009304" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009016" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.005181" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007336" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.007033" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009301" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.006463" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003648" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003838" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003989" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003885" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004211" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.010019" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.2.1
Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/GMT+1) in /in/bGhje:3 Stack trace: #0 /in/bGhje(3): DateTimeZone->__construct('Etc/GMT+1') #1 {main} thrown in /in/bGhje on line 3
Process exited with code 255.
Output for 8.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:42.004396" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.008221" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.009239" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.006878" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.008827" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004640" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.008464" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003524" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003746" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.003455" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004187" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:47.004066" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }
Output for 8.1.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2023-01-04 12:37:35.003805" ["timezone_type"]=> int(3) ["timezone"]=> string(9) "Etc/GMT+1" }

preferences:
140.8 ms | 529 KiB | 5 Q