3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public function calc($a){ $privateVar = 100; function some($b){ //echo $privateVar; return ($b * 3); } $c = some($a) * 2; echo $privateVar . "\n"; return $c; } } $test = new MyClass(); $saveValue = $test->calc(10); echo $saveValue;

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.70.0120.00616.36
8.3.60.0070.01018.28
8.3.50.0140.00721.02
8.3.40.0090.00618.72
8.3.30.0060.00918.59
8.3.20.0000.00720.25
8.3.10.0050.00323.48
8.3.00.0040.00719.56
8.2.190.0090.00616.58
8.2.180.0060.00918.23
8.2.170.0040.01122.96
8.2.160.0060.01320.39
8.2.150.0040.00424.18
8.2.140.0070.01124.66
8.2.130.0000.00826.16
8.2.120.0060.00319.61
8.2.110.0030.00620.36
8.2.100.0090.00317.85
8.2.90.0000.00818.22
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0040.00419.41
8.2.30.0090.00019.87
8.2.20.0050.00217.68
8.2.10.0070.00018.11
8.2.00.0040.00418.00
8.1.280.0140.00025.92
8.1.270.0040.00420.32
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00422.18
8.1.230.0070.00320.88
8.1.220.0030.00517.79
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0070.00018.10
8.1.170.0000.00818.49
8.1.160.0040.00422.01
8.1.150.0000.00718.89
8.1.140.0000.01117.50
8.1.130.0000.00717.66
8.1.120.0030.00317.43
8.1.110.0000.00817.38
8.1.100.0040.00417.42
8.1.90.0040.00417.48
8.1.80.0060.00317.48
8.1.70.0070.00017.41
8.1.60.0040.00417.55
8.1.50.0040.00417.45
8.1.40.0000.00917.50
8.1.30.0030.00917.55
8.1.20.0040.00417.55
8.1.10.0000.00717.53
8.1.00.0040.00417.41
8.0.300.0000.00720.07
8.0.290.0000.00816.73
8.0.280.0070.00018.45
8.0.270.0000.00717.25
8.0.260.0060.00017.27
8.0.250.0000.00716.99
8.0.240.0030.00316.82
8.0.230.0070.00016.87
8.0.220.0080.00016.93
8.0.210.0000.00816.80
8.0.200.0000.00616.86
8.0.190.0000.00816.85
8.0.180.0040.00416.91
8.0.170.0040.00416.82
8.0.160.0040.00416.97
8.0.150.0070.00016.75
8.0.140.0040.00416.92
8.0.130.0040.00413.35
8.0.120.0040.00416.86
8.0.110.0030.00516.93
8.0.100.0050.00316.96
8.0.90.0040.00416.77
8.0.80.0000.01516.85
8.0.70.0070.00016.70
8.0.60.0070.00016.77
8.0.50.0000.00816.93
8.0.30.0060.01116.97
8.0.20.0150.00917.40
8.0.10.0000.00717.05
8.0.00.0130.00616.61
7.4.330.0000.00515.08
7.4.320.0060.00016.59
7.4.300.0030.00316.52
7.4.290.0050.00216.42
7.4.280.0000.00716.45
7.4.270.0000.00616.43
7.4.260.0060.00016.48
7.4.250.0000.00716.57
7.4.240.0050.00216.56
7.4.230.0000.00716.63
7.4.220.0100.01316.63
7.4.210.0040.01016.61
7.4.200.0000.00716.25
7.4.160.0040.01116.55
7.4.150.0060.01217.40
7.4.140.0120.01017.86
7.4.130.0100.00816.46
7.4.120.0090.00816.58
7.4.110.0190.00016.55
7.4.100.0150.00616.32
7.4.90.0100.00716.52
7.4.80.0150.00619.39
7.4.70.0060.01216.58
7.4.60.0130.00316.45
7.4.50.0030.00316.23
7.4.40.0120.00716.52
7.4.30.0150.00316.52
7.4.00.0030.01015.11
7.3.330.0060.00013.08
7.3.320.0000.00613.16
7.3.310.0000.00716.16
7.3.300.0000.00716.30
7.3.290.0090.00716.28
7.3.280.0120.00616.27
7.3.270.0120.00617.40
7.3.260.0060.01016.63
7.3.250.0140.00616.48
7.3.240.0070.01016.36
7.3.230.0090.00816.39
7.3.210.0100.00616.61
7.3.200.0100.00716.37
7.3.190.0160.00016.44
7.3.180.0000.01616.46
7.3.170.0130.00316.57
7.3.160.0190.00416.51
7.3.10.0030.01016.78
7.3.00.0040.00716.70
7.2.330.0140.00316.71
7.2.320.0140.00316.79
7.2.310.0040.01216.72
7.2.300.0160.00816.68
7.2.290.0040.01416.74
7.2.130.0040.00717.07
7.2.120.0060.01016.78
7.2.110.0070.00316.93
7.2.100.0040.00816.78
7.2.90.0070.00717.16
7.2.80.0100.00717.15
7.2.70.0100.00316.97
7.2.60.0040.01216.82
7.2.50.0100.01016.61
7.2.40.0060.00616.88
7.2.30.0030.00716.82
7.2.20.0040.00717.05
7.2.10.0000.01316.88
7.2.00.0060.00316.94
7.1.250.0030.00615.82
7.1.200.0100.00315.73
7.1.100.0030.01317.87
7.1.70.0000.01617.10
7.1.60.0000.02219.12
7.1.50.0090.00916.77
7.1.00.0000.08022.45
7.0.200.0130.00916.80
7.0.60.0000.04319.94
7.0.50.0030.08317.82
7.0.40.0030.04320.20
7.0.30.0170.04320.07
7.0.20.0430.07320.20
7.0.10.0030.07320.06
7.0.00.0030.09020.20
5.6.280.0030.03320.91
5.6.210.0070.08320.72
5.6.200.0030.08018.20
5.6.190.0030.06020.33
5.6.180.0370.06720.46
5.6.170.0300.04720.62
5.6.160.0100.05320.44
5.6.150.0200.07018.16
5.6.140.0000.05318.18
5.6.130.0100.07318.18
5.6.120.0130.08021.04
5.6.110.0070.04021.02
5.6.100.0130.07320.98
5.6.90.0030.04021.09
5.6.80.0100.06320.41
5.6.70.3030.03720.38
5.5.350.0100.03720.43
5.5.340.0070.08017.96
5.5.330.0070.07020.41
5.5.320.0000.04020.30
5.5.310.0330.06320.24
5.5.300.0030.05317.94
5.5.290.0030.08718.09
5.5.280.0070.07720.88
5.5.270.0100.05020.84
5.5.260.0130.05720.77
5.5.250.0130.07720.78
5.5.240.0230.07320.34
5.4.450.0670.06319.47
5.4.440.1270.05719.16
5.4.430.1070.07319.49
5.4.420.0630.06019.58
5.4.410.0830.03719.34
5.4.400.0900.05019.23
5.4.390.0830.04319.09
5.4.380.0730.04719.36
5.4.370.0630.05718.98
5.4.360.1000.07718.87
5.4.350.1200.05319.14
5.4.340.1000.07319.01
5.4.320.0830.07018.86
5.4.310.0600.06319.26
5.4.300.1070.04319.36
5.4.290.0900.04319.32
5.4.280.0770.04719.24
5.4.270.0730.04319.14
5.4.260.0600.05719.30
5.4.250.0530.06019.05
5.4.240.0700.05718.83
5.4.230.0800.06719.25
5.4.220.0800.04018.86
5.4.210.0830.07319.24
5.4.200.1030.07018.86
5.4.190.0900.05019.05
5.4.180.0630.05318.98
5.4.170.0770.05719.21
5.4.160.0730.06318.85
5.4.150.0730.05719.00
5.4.140.0730.05016.48
5.4.130.0730.05316.43
5.4.120.0800.05316.53
5.4.110.0730.06016.67
5.4.100.0670.05016.50
5.4.90.0730.05016.47
5.4.80.0930.03316.45
5.4.70.0200.07016.39
5.4.60.0270.02716.17
5.4.50.0030.05316.17
5.4.40.0070.06016.43
5.4.30.0030.03316.42
5.4.20.0000.08016.61

preferences:
44.84 ms | 401 KiB | 5 Q