3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private static DateTimeImmutable $bar; private static ?string $foo; public static function getBar(): DateTimeImmutable { return self::$bar ??= new DateTimeImmutable(); } public static function getFoo(): ?string { return self::$foo ??= null; } public static function setFoo(string $foo): void { self::$foo = $foo; } } var_dump(Foo::getBar()); var_dump(Foo::getBar()); var_dump(Foo::getFoo()); Foo::setFoo('test'); var_dump(Foo::getFoo());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0140.00718.68
8.3.50.0090.00618.40
8.3.40.0070.00718.99
8.3.30.0070.00719.04
8.3.20.0040.00420.73
8.3.10.0050.00320.21
8.3.00.0080.00020.77
8.2.180.0140.00718.33
8.2.170.0100.00722.96
8.2.160.0000.01422.20
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0000.00726.16
8.2.110.0100.00020.52
8.2.100.0070.00417.68
8.2.90.0040.00418.03
8.2.80.0040.00419.26
8.2.70.0080.00018.05
8.2.60.0050.00318.16
8.2.50.0040.00418.10
8.2.40.0080.00019.48
8.2.30.0040.00419.16
8.2.20.0000.00717.95
8.2.10.0090.00019.08
8.2.00.0000.00819.23
8.1.280.0120.00925.92
8.1.270.0000.00822.60
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00422.06
8.1.230.0060.00622.65
8.1.220.0030.00617.74
8.1.210.0000.00918.79
8.1.200.0030.01017.48
8.1.190.0080.00017.48
8.1.180.0030.00618.97
8.1.170.0090.00018.77
8.1.160.0050.00219.09
8.1.150.0040.00418.78
8.1.140.0040.00422.16
8.1.130.0000.00817.50
8.1.120.0070.00017.52
8.1.110.0040.00417.57
8.1.100.0040.00417.45
8.1.90.0000.00817.47
8.1.80.0040.00417.64
8.1.70.0030.00317.61
8.1.60.0040.00417.60
8.1.50.0040.00417.66
8.1.40.0060.00317.55
8.1.30.0040.00417.75
8.1.20.0040.00417.80
8.1.10.0040.00417.68
8.1.00.0040.00417.68
8.0.300.0040.00420.10
8.0.290.0030.00616.75
8.0.280.0000.00718.38
8.0.270.0030.00517.27
8.0.260.0070.00016.91
8.0.250.0030.00717.09
8.0.240.0040.00416.97
8.0.230.0000.00717.16
8.0.220.0040.00417.00
8.0.210.0030.00317.02
8.0.200.0000.00817.13
8.0.190.0000.00716.98
8.0.180.0040.00417.11
8.0.170.0060.00317.04
8.0.160.0070.00017.05
8.0.150.0080.00317.01
8.0.140.0040.00417.03
8.0.130.0000.00613.36
8.0.120.0080.00016.93
8.0.110.0040.00416.88
8.0.100.0070.00016.89
8.0.90.0060.00317.04
8.0.80.0060.01116.98
8.0.70.0000.00716.86
8.0.60.0000.00716.96
8.0.50.0000.00716.95
8.0.30.0090.00917.43
8.0.20.0140.00717.39
8.0.10.0000.00717.04
8.0.00.0090.00917.13
7.4.330.0030.00315.55
7.4.320.0000.00716.51
7.4.300.0060.00316.75
7.4.290.0000.00816.67
7.4.280.0040.00416.72
7.4.270.0070.00016.70
7.4.260.0000.00613.36
7.4.250.0000.00716.47
7.4.240.0020.00616.72
7.4.230.0030.00316.65
7.4.220.0060.00216.82
7.4.210.0070.01016.67
7.4.200.0000.00816.86
7.4.140.0110.00717.86
7.4.130.0150.00316.69
7.4.120.0160.00316.59
7.4.110.0130.00616.93
7.4.100.0100.00716.57
7.4.90.0130.01016.66
7.4.80.0100.00719.39
7.4.70.0110.00616.48
7.4.60.0060.00916.61
7.4.50.0110.00216.48
7.4.40.0060.01216.71
7.4.10.0070.01115.29
7.4.00.0050.00915.18
7.3.330.0030.00616.25
7.3.320.0000.00513.19
7.3.310.0000.00716.23
7.3.300.0000.00716.03
7.3.290.0060.00816.11
7.3.280.0150.00616.18
7.3.260.0130.00416.16
7.3.240.0100.00816.26
7.3.230.0060.01216.38
7.3.210.0070.01016.08
7.3.200.0040.01216.27
7.3.190.0040.01116.25
7.3.180.0070.01016.21
7.3.170.0090.01216.33
7.3.160.0100.01016.32
7.3.130.0110.00715.11
7.3.120.0070.00514.90
7.3.110.0030.01114.85
7.3.100.0050.01114.92
7.3.90.0070.00714.90
7.3.80.0070.00614.88
7.3.70.0070.00614.87
7.3.60.0070.00414.90
7.3.50.0060.00814.84
7.3.40.0080.00814.77
7.3.30.0080.00714.87
7.3.20.0110.00615.57
7.3.10.0070.00615.39
7.3.00.0050.01115.54
7.2.330.0180.00316.41
7.2.320.0090.00916.52
7.2.310.0150.00316.25
7.2.300.0030.01416.30
7.2.290.0030.01316.29
7.2.260.0000.01715.11
7.2.250.0100.00514.89
7.2.240.0050.00915.07
7.2.230.0090.00714.86
7.2.220.0090.00815.02
7.2.210.0100.00515.04
7.2.200.0090.00715.03
7.2.190.0080.00514.80
7.2.180.0070.00915.02
7.2.170.0060.00814.79
7.2.160.0040.00815.11
7.2.150.0090.00616.74
7.2.140.0150.00016.87
7.2.130.0030.00716.40
7.2.120.0100.00316.53
7.2.110.0000.01016.82
7.2.100.0000.01516.84
7.2.90.0100.00617.01
7.2.80.0060.00916.80
7.2.70.0070.00316.68
7.2.60.0030.01116.61
7.2.50.0030.01216.59
7.2.40.0070.00716.83
7.2.30.0030.01216.66
7.2.20.0090.00916.56
7.2.10.0120.00616.94
7.2.00.0030.00616.90
7.1.330.0080.00613.41
7.1.320.0110.00413.65
7.1.310.0000.01513.76
7.1.300.0130.00013.73
7.1.290.0060.01113.82
7.1.280.0070.01313.76
7.1.270.0120.00813.64
7.1.260.0140.00313.73

preferences:
62.94 ms | 401 KiB | 5 Q