3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(&$a, $b) { $a = 'modified'; $b = 'modified'; } class C { function foo(&$a, $b) { $a = 'modified'; $b = 'modified'; } } class S { static function foo(&$a, $b) { $a = 'modified'; $b = 'modified'; } } $vv["'foo'"] = 'foo'; $vv["['S', 'foo']"] = ['S', 'foo']; $vv["[new C, 'foo']"] = [new C, 'foo']; $vv["function(..){..}"] = function(&$a, $b) { $a = 'modified'; $b = 'modified'; }; $vv["'S::foo'"] = 'S::foo'; foreach ($vv as $label => $v) { print $label; print is_callable($v) ? 'is callable' : 'is not callable'; print "\n"; $a = 'orig'; $b = 'orig'; call_user_func_array($v, array(&$a, &$b)); assert($a === 'modified'); assert($b === 'orig'); $a = 'orig'; $b = 'orig'; $v($a, $b); assert($a === 'modified'); assert($b === 'orig'); }

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.80.0060.00318.52
8.3.70.0040.01116.25
8.3.60.0140.00718.56
8.3.50.0090.01022.00
8.3.40.0130.00318.98
8.3.30.0140.00018.68
8.3.20.0070.00020.16
8.3.10.0040.00421.77
8.3.00.0050.00319.91
8.2.200.0070.00318.41
8.2.190.0070.00718.54
8.2.180.0110.00418.29
8.2.170.0100.00722.96
8.2.160.0030.01019.41
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00020.94
8.2.120.0040.00426.35
8.2.110.0040.00422.14
8.2.100.0070.00417.85
8.2.90.0040.00718.22
8.2.80.0030.00617.97
8.2.70.0050.00317.50
8.2.60.0100.00217.68
8.2.50.0060.00618.10
8.2.40.0000.00820.45
8.2.30.0000.00719.41
8.2.20.0000.00717.91
8.2.10.0040.00418.03
8.2.00.0040.00418.15
8.1.290.0090.00030.84
8.1.280.0120.00325.92
8.1.270.0050.00323.88
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0040.00423.92
8.1.230.0060.00622.82
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0100.00017.35
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0000.00818.64
8.1.160.0000.00722.09
8.1.150.0040.00418.98
8.1.140.0040.00419.62
8.1.130.0000.00717.67
8.1.120.0030.00717.56
8.1.110.0030.00517.32
8.1.100.0030.00617.50
8.1.90.0040.00417.35
8.1.80.0000.00717.52
8.1.70.0000.00717.38
8.1.60.0040.00417.62
8.1.50.0060.00317.59
8.1.40.0000.00817.40
8.1.30.0040.00417.68
8.1.20.0000.00717.61
8.1.10.0050.00317.65
8.1.00.0050.00217.38
8.0.300.0000.00821.87
8.0.290.0000.00816.75
8.0.280.0030.00318.50
8.0.270.0000.00717.14
8.0.260.0030.00317.22
8.0.250.0030.00317.09
8.0.240.0040.00417.06
8.0.230.0030.00317.02
8.0.220.0040.00416.89
8.0.210.0040.00416.94
8.0.200.0030.00317.00
8.0.190.0040.00417.04
8.0.180.0000.00716.86
8.0.170.0000.00816.97
8.0.160.0070.00017.03
8.0.150.0040.00416.89
8.0.140.0050.00517.00
8.0.130.0030.00313.45
8.0.120.0050.00516.94
8.0.110.0000.00716.92
8.0.100.0000.00917.04
8.0.90.0000.00716.83
8.0.80.0040.01116.95
8.0.70.0030.00316.97
8.0.60.0070.00017.00
8.0.50.0000.00716.92
8.0.30.0110.00817.01
8.0.20.0100.01017.40
8.0.10.0000.00817.06
8.0.00.0090.00916.88
7.4.330.0000.00515.08
7.4.320.0060.00016.54
7.4.300.0040.00416.45
7.4.290.0000.00716.52
7.4.280.0070.00016.48
7.4.270.0000.00716.59
7.4.260.0050.00316.67
7.4.250.0040.00416.60
7.4.240.0050.00316.55
7.4.230.0070.00016.65
7.4.220.0130.01016.63
7.4.210.0090.00916.54
7.4.200.0070.00016.64
7.4.160.0060.01016.61
7.4.150.0070.01017.40
7.4.140.0110.01117.86
7.4.130.0130.00416.59
7.4.120.0090.00716.55
7.4.110.0090.00916.55
7.4.100.0090.00916.60
7.4.90.0110.00816.44
7.4.80.0090.01019.39
7.4.70.0080.01216.72
7.4.60.0140.00416.51
7.4.50.0090.00216.53
7.4.40.0100.01016.64
7.4.30.0080.01116.78
7.4.00.0050.01014.89
7.3.330.0030.00313.31
7.3.320.0030.00313.43
7.3.310.0000.00816.35
7.3.300.0000.00616.41
7.3.290.0030.00316.27
7.3.280.0100.00716.42
7.3.270.0150.00317.40
7.3.260.0130.00416.57
7.3.250.0090.00916.51
7.3.240.0110.00616.44
7.3.230.0120.00916.41
7.3.210.0040.01516.67
7.3.200.0030.01516.52
7.3.190.0130.00316.54
7.3.180.0130.00416.40
7.3.170.0120.00916.41
7.3.160.0130.00516.41
7.3.120.0100.01014.91
7.3.110.0060.00914.77
7.3.100.0070.00714.81
7.3.90.0100.00314.69
7.3.80.0060.00614.86
7.3.70.0070.01014.94
7.3.60.0100.00314.82
7.3.50.0070.00714.72
7.3.40.0000.01214.88
7.3.30.0000.01415.00
7.3.20.0040.00416.64
7.3.10.0040.01016.66
7.3.00.0050.00916.70
7.2.330.0120.00616.85
7.2.320.0100.00716.70
7.2.310.0100.00716.64
7.2.300.0110.01116.72
7.2.290.0140.00316.79
7.2.250.0070.01115.33
7.2.240.0100.01015.11
7.2.230.0080.00815.00
7.2.220.0040.01214.83
7.2.210.0100.00015.11
7.2.200.0140.00015.01
7.2.190.0060.00614.98
7.2.180.0070.00415.05
7.2.170.0100.00315.12
7.2.160.0070.01014.98
7.2.150.0030.00916.65
7.2.140.0060.00616.91
7.2.130.0040.01016.95
7.2.120.0040.00816.98
7.2.110.0100.00317.00
7.2.100.0040.00916.89
7.2.90.0020.01117.08
7.2.80.0040.00916.91
7.2.70.0050.00716.88
7.2.60.0070.00716.98
7.2.50.0080.00517.01
7.2.40.0090.00517.05
7.2.30.0100.00416.89
7.2.20.0040.00816.97
7.2.10.0060.00816.94
7.2.00.0040.01217.56
7.1.330.0090.00915.75
7.1.320.0060.00615.74
7.1.310.0070.00715.70
7.1.300.0040.01115.85
7.1.290.0000.00815.84
7.1.280.0070.00715.51
7.1.270.0030.00615.88
7.1.260.0070.00715.81
7.1.250.0020.00915.72
7.1.240.0060.00315.56
7.1.230.0040.01115.96
7.1.220.0030.00615.96
7.1.210.0060.00615.55
7.1.200.0080.00515.72
7.1.190.0040.00715.54
7.1.180.0060.00615.84
7.1.170.0060.00615.94
7.1.160.0040.01215.91
7.1.150.0030.00615.71
7.1.140.0030.00915.78
7.1.130.0030.00615.80
7.1.120.0070.00315.94
7.1.110.0070.00715.82
7.1.100.0060.00617.08
7.1.90.0030.01015.97
7.1.80.0060.00915.83
7.1.70.0040.00516.57
7.1.60.0000.01117.69
7.1.50.0110.00916.36
7.1.40.0060.00615.88
7.1.30.0030.01415.85
7.1.20.0090.00915.95
7.1.10.0030.00715.88
7.1.00.0030.04219.11
7.0.330.0000.00915.62
7.0.320.0030.01015.38
7.0.310.0070.00315.39
7.0.300.0040.00715.22
7.0.290.0120.00315.63
7.0.280.0030.00615.42
7.0.270.0060.00615.48
7.0.260.0040.00415.45
7.0.250.0030.00915.43
7.0.240.0030.01015.58
7.0.230.0030.00615.56
7.0.220.0060.00915.63
7.0.210.0080.00015.50
7.0.200.0000.01016.19
7.0.190.0080.00615.45
7.0.180.0000.01415.43
7.0.170.0000.00915.59
7.0.160.0070.00715.33
7.0.150.0060.01015.22
7.0.140.0000.01515.42
7.0.130.0090.00615.61
7.0.120.0100.00015.66
7.0.110.0130.00015.28
7.0.100.0120.00315.30
7.0.90.0060.00515.47
7.0.80.0930.04317.81
7.0.70.0090.04217.52
7.0.60.0120.03317.68
7.0.50.0050.04117.95
7.0.40.0730.03316.91
7.0.30.0180.03516.88
7.0.20.0080.04716.82
7.0.10.0100.03516.89
7.0.00.0090.03216.97
5.6.400.0030.00914.86
5.6.390.0060.00814.73
5.6.380.0060.00614.44
5.6.370.0070.00314.16
5.6.360.0030.01014.68
5.6.350.0100.00714.50
5.6.340.0030.00914.67
5.6.330.0070.00314.43
5.6.320.0000.01114.46
5.6.310.0080.00314.68
5.6.300.0130.00014.33
5.6.290.0070.00714.72
5.6.280.0100.00314.80
5.6.270.0100.00314.60
5.6.260.0100.00314.63
5.6.250.0030.01014.64
5.6.240.0030.00714.17
5.6.230.0050.03617.44
5.6.220.0100.03717.62
5.6.210.0140.03217.55
5.6.200.0100.03517.89
5.6.190.0170.03017.74
5.6.180.0060.04317.90
5.6.170.0100.03917.74
5.6.160.0130.03017.91
5.6.150.0100.03517.63
5.6.140.0070.03717.66
5.6.130.0100.03217.77
5.6.120.0070.03517.80
5.6.110.0070.04317.67
5.6.100.0130.03817.69
5.6.90.0130.03717.62
5.6.80.0060.03617.39
5.6.70.0120.02717.52
5.6.60.0050.03417.39
5.6.50.0160.03617.43
5.6.40.0140.02517.36
5.6.30.0110.03317.34
5.6.20.0070.03617.54
5.6.10.0080.03217.35
5.6.00.0030.03717.35
5.5.380.0000.01214.46
5.5.370.0000.01414.11
5.5.360.0000.01114.59
5.5.350.0000.01314.27
5.5.340.0100.00714.59
5.5.330.0060.00914.56
5.5.320.0030.01014.22
5.5.310.0110.00314.60
5.5.300.0030.01014.39
5.5.290.0030.00914.57
5.5.280.0000.01514.40
5.5.270.0000.01114.22
5.5.260.0060.00614.41
5.5.250.0060.00614.43
5.5.240.0000.01414.31
5.5.230.0090.00314.22
5.5.220.0000.01414.29
5.5.210.0060.00614.32
5.5.200.0030.00914.55
5.5.190.0090.00314.03
5.5.180.0060.00614.44
5.5.170.0100.00314.26
5.5.160.0040.00414.39
5.5.150.0060.00613.98
5.5.140.0080.00414.16
5.5.130.0090.00614.36
5.5.120.0030.00614.56
5.5.110.0040.00814.51
5.5.100.0030.01014.13
5.5.90.0090.00614.30
5.5.80.0100.00314.27
5.5.70.0080.00414.61
5.5.60.0060.00914.53
5.5.50.0000.00914.04
5.5.40.0030.01314.25
5.5.30.0030.01314.31
5.5.20.0080.00314.66
5.5.10.0000.01114.00
5.5.00.0060.00614.48

preferences:
31.53 ms | 401 KiB | 5 Q