3v4l.org

run code in 300+ PHP versions simultaneously
<?php class_alias('Datetime', 'DT'); $d = new DT(); var_dump($d);
Output for 8.4.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009819" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004207" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004195" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.010020" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009808" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.010499" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.010268" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.010601" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.010193" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.010465" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.011093" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.4.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004301" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.008758" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.008790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.003951" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009830" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009275" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004011" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.007874" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.003878" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009007" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.005538" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.008675" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.008666" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004096" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009810" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.008433" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004404" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004232" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.004150" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.007039" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.007208" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.007367" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.009017" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.007066" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.003704" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.003806" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2022-11-15 02:25:02.003727" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.12 - 8.1.33, 8.2.10 - 8.2.29
Fatal error: Uncaught ValueError: class_alias(): Argument #1 ($class) must be a user-defined class name, internal class name given in /in/m2clO:3 Stack trace: #0 /in/m2clO(3): class_alias('Datetime', 'DT') #1 {main} thrown in /in/m2clO on line 3
Process exited with code 255.

preferences:
91.46 ms | 465 KiB | 5 Q