3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return 'bar'; } } $services = []; function foo() { global $services; return $services['foo'] = new Foo(); } // $services['foo'] = new Foo(); echo ($var = isset($services['foo']) ? $services['foo'] : foo())->bar();

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.5.00.0140.00819.95
8.4.150.0020.00014.05
8.4.140.0100.01119.46
8.4.130.0030.00617.62
8.4.120.0150.00520.54
8.4.110.0110.00622.49
8.4.100.0140.00617.98
8.4.90.0100.01117.64
8.4.80.0050.00318.02
8.4.70.0010.00818.01
8.4.60.0130.00918.64
8.4.50.0140.00717.70
8.4.40.0150.00719.62
8.4.30.0150.00319.73
8.4.20.0170.00320.69
8.4.10.0060.00317.91
8.3.280.0150.01018.43
8.3.270.0110.00816.52
8.3.260.0110.00816.51
8.3.250.0150.00318.76
8.3.240.0090.01016.75
8.3.230.0120.00716.34
8.3.220.0080.00717.13
8.3.210.0100.00816.77
8.3.200.0040.00516.64
8.3.190.0050.00316.98
8.3.180.0120.00717.04
8.3.170.0060.00916.70
8.3.160.0060.01216.66
8.3.150.0120.00317.31
8.3.140.0040.00416.83
8.3.130.0060.00318.38
8.3.120.0140.00720.81
8.3.110.0040.00420.94
8.3.100.0060.00316.49
8.3.90.0110.00726.77
8.3.80.0030.00618.56
8.3.70.0120.00316.63
8.3.60.0120.00918.43
8.3.50.0030.01117.92
8.3.40.0090.00918.79
8.3.30.0110.00418.71
8.3.20.0050.00219.19
8.3.10.0040.00423.48
8.3.00.0040.00420.89
8.2.290.0100.00820.51
8.2.280.0120.00620.32
8.2.270.0060.01217.16
8.2.260.0040.00418.80
8.2.250.0030.01216.59
8.2.240.0070.00316.96
8.2.230.0060.00322.58
8.2.220.0000.00824.06
8.2.210.0080.00026.77
8.2.200.0090.00018.88
8.2.190.0120.00616.63
8.2.180.0060.01318.54
8.2.170.0150.00322.96
8.2.160.0110.00322.26
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0050.00221.00
8.2.120.0050.00326.35
8.2.110.0060.00321.13
8.2.100.0080.00817.91
8.2.90.0000.00817.61
8.2.80.0040.00417.97
8.2.70.0080.00017.93
8.2.60.0030.00618.34
8.2.50.0000.00818.10
8.2.40.0040.00421.32
8.2.30.0040.00419.19
8.2.20.0060.00318.04
8.2.10.0030.00517.93
8.2.00.0040.00419.45
8.1.330.0090.01020.23
8.1.320.0110.00716.11
8.1.310.0030.00518.62
8.1.300.0000.00917.96
8.1.290.0090.00030.84
8.1.280.0140.00325.92
8.1.270.0070.00022.05
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0000.00919.22
8.1.230.0030.00919.22
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0070.00717.09
8.1.190.0060.00317.23
8.1.180.0000.00818.10
8.1.170.0030.00618.58
8.1.160.0000.00718.88
8.1.150.0000.00718.82
8.1.140.0070.00022.04
8.1.130.0000.00720.07
8.1.120.0000.00717.38
8.1.110.0040.00417.28
8.1.100.0030.00717.40
8.1.90.0030.00617.29
8.1.80.0040.00417.36
8.1.70.0000.00817.34
8.1.60.0030.00517.45
8.1.50.0000.00817.39
8.1.40.0040.00417.39
8.1.30.0040.00417.65
8.1.20.0050.00317.47
8.1.10.0000.00717.51
8.1.00.0000.00817.53
8.0.300.0030.00519.63
8.0.290.0000.00716.72
8.0.280.0070.00018.49
8.0.270.0030.00317.26
8.0.260.0030.00318.41
8.0.250.0050.00316.88
8.0.240.0000.00616.99
8.0.230.0000.00716.88
8.0.220.0000.00716.72
8.0.210.0000.00816.85
8.0.200.0040.00416.77
8.0.190.0030.00516.89
8.0.180.0080.00016.88
8.0.170.0060.00316.86
8.0.160.0000.00716.79
8.0.150.0040.00416.75
8.0.140.0040.00416.66
8.0.130.0030.00313.23
8.0.120.0050.00316.69
8.0.110.0030.00516.63
8.0.100.0070.00016.71
8.0.90.0040.00416.78
8.0.80.0080.00816.75
8.0.70.0050.00216.83
8.0.60.0070.00016.87
8.0.50.0030.00516.66
8.0.30.0120.00617.00
8.0.20.0110.00917.40
8.0.10.0040.00416.84
8.0.00.0100.00916.50
7.4.330.0000.00515.55
7.4.320.0070.00016.52
7.4.300.0000.00716.55
7.4.290.0000.00816.64
7.4.280.0040.00416.50
7.4.270.0000.00716.64
7.4.260.0030.00316.57
7.4.250.0000.00716.57
7.4.240.0000.00716.50
7.4.230.0030.00316.34
7.4.220.0050.00316.33
7.4.210.0070.00816.63
7.4.200.0000.00716.60
7.4.160.0080.01016.48
7.4.140.0140.01017.86
7.4.130.0090.00916.56
7.4.120.0090.00916.52
7.4.110.0070.01716.46
7.4.100.0140.00416.43
7.4.90.0100.01016.50
7.4.80.0090.00919.39
7.4.70.0070.01316.54
7.4.60.0090.00616.52
7.4.50.0060.00816.43
7.4.40.0100.00716.39
7.4.00.0070.00714.80
7.3.330.0000.00613.18
7.3.320.0000.00513.36
7.3.310.0070.00016.34
7.3.300.0040.00416.21
7.3.290.0000.00716.23
7.3.280.0070.00716.34
7.3.260.0110.00916.36
7.3.240.0090.00816.35
7.3.230.0120.00616.15
7.3.210.0130.00316.72
7.3.200.0100.01316.40
7.3.190.0110.00516.43
7.3.180.0100.00716.39
7.3.170.0150.00816.56
7.3.160.0100.00616.59
7.2.330.0100.01016.56
7.2.320.0100.00716.72
7.2.310.0040.01216.63
7.2.300.0150.00616.46
7.2.290.0090.00916.74
7.2.120.1080.00314.73
7.2.110.0120.01214.76
7.2.100.0040.01114.76
7.2.90.0280.00014.47
7.2.80.1320.00614.13
7.2.70.0070.01114.84
7.2.60.1500.01414.86
7.2.50.0110.00715.03
7.2.40.0130.01015.02
7.2.30.0320.00514.90
7.2.20.0180.00814.75
7.2.10.0140.00914.96
7.2.00.0610.00414.93
7.1.240.1260.00913.62
7.1.230.1150.00713.91
7.1.220.0520.00413.77
7.1.210.1030.00313.95
7.1.200.1190.00013.89
7.1.190.0120.00413.73
7.1.180.0140.00014.20
7.1.170.0400.00713.65
7.1.160.0100.00714.02
7.1.150.0170.00313.84
7.1.140.0860.00714.06
7.1.130.0120.00813.69
7.1.120.1840.00613.65
7.1.110.0110.00614.07
7.1.100.2260.00713.94
7.1.90.0080.00814.20
7.1.80.0080.00513.76
7.1.70.0540.01314.01
7.1.60.0420.00014.01
7.1.50.0080.00813.86
7.1.40.0130.00313.67
7.1.30.0080.00813.92
7.1.20.0110.00813.95
7.1.10.0140.00713.82
7.1.00.0340.00713.65
5.6.380.0090.00614.18

preferences:
142.76 ms | 403 KiB | 5 Q