3v4l.org

run code in 300+ PHP versions simultaneously
<?php class sM { static private $_methods = array(); static public function addMethod($name, Closure $cb) { self::$_methods[$name] = $cb; } public function __call($name, array $args) { array_unshift($args, $this); return call_user_func_array(self::$_methods[$name], $args); } public function add($a, $b) { return $a + $b; } } foreach (array(10,100,1000) as $base) { sM::addMethod('add'.$base, function($self, $number) use ($base) { return $self->add($number, $base); }); } $sM = new sM(); echo $sM->add10(1)."\n"; echo $sM->add100(1)."\n"; echo $sM->add1000(1)."\n";

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.00416.50
8.3.50.0090.00616.52
8.3.40.0130.00319.06
8.3.30.0040.01218.71
8.3.20.0040.00419.16
8.3.10.0080.00019.00
8.3.00.0040.00417.79
8.2.180.0090.01216.63
8.2.170.0040.01122.96
8.2.160.0030.01020.77
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0080.00019.77
8.2.120.0070.00026.35
8.2.110.0060.00320.54
8.2.100.0040.00717.84
8.2.90.0030.00517.73
8.2.80.0080.00018.93
8.2.70.0040.00418.05
8.2.60.0030.00517.93
8.2.50.0050.00318.10
8.2.40.0000.00821.16
8.2.30.0000.00719.55
8.2.20.0040.00418.03
8.2.10.0040.00418.07
8.2.00.0000.00719.52
8.1.280.0120.00325.92
8.1.270.0090.00023.97
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0000.00917.64
8.1.230.0070.00420.44
8.1.220.0030.00617.79
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0030.00618.50
8.1.160.0000.00718.82
8.1.150.0070.00018.96
8.1.140.0040.00417.61
8.1.130.0040.00418.98
8.1.120.0070.00417.39
8.1.110.0040.00417.39
8.1.100.0020.00517.48
8.1.90.0080.00017.56
8.1.80.0070.00017.52
8.1.70.0000.00817.54
8.1.60.0080.00317.67
8.1.50.0080.00017.42
8.1.40.0040.00417.54
8.1.30.0000.00817.66
8.1.20.0040.00417.58
8.1.10.0070.00017.58
8.1.00.0080.00017.53
8.0.300.0070.00018.77
8.0.290.0040.00417.30
8.0.280.0040.00418.39
8.0.270.0000.00717.20
8.0.260.0040.00417.28
8.0.250.0000.00716.93
8.0.240.0080.00016.92
8.0.230.0040.00416.91
8.0.220.0030.00317.02
8.0.210.0000.00716.91
8.0.200.0060.00017.12
8.0.190.0040.00417.10
8.0.180.0000.00716.97
8.0.170.0040.00416.98
8.0.160.0030.00517.01
8.0.150.0030.00616.86
8.0.140.0040.00416.97
8.0.130.0000.00613.46
8.0.120.0000.00716.96
8.0.110.0050.00316.80
8.0.100.0000.00716.87
8.0.90.0040.00417.02
8.0.80.0090.01016.96
8.0.70.0050.00217.00
8.0.60.0000.00716.80
8.0.50.0040.00416.81
8.0.30.0080.01017.12
8.0.20.0170.00717.40
8.0.10.0040.00417.21
8.0.00.0080.01316.77
7.4.330.0050.00015.55
7.4.320.0040.00416.59
7.4.300.0000.00616.52
7.4.290.0000.00816.59
7.4.280.0040.00416.51
7.4.270.0070.00016.53
7.4.260.0030.00316.44
7.4.250.0000.00816.49
7.4.240.0070.00016.63
7.4.230.0000.00716.63
7.4.220.0000.00816.28
7.4.210.0070.00916.50
7.4.200.0030.00316.74
7.4.160.0110.00516.56
7.4.140.0100.01017.86
7.4.130.0030.01516.42
7.4.120.0110.01116.59
7.4.110.0150.00416.59
7.4.100.0160.00316.68
7.4.90.0040.01516.76
7.4.80.0090.00919.39
7.4.70.0080.00816.49
7.4.60.0090.01516.48
7.4.50.0120.00216.60
7.4.40.0110.00616.60
7.4.00.0060.01014.92
7.3.330.0060.00013.36
7.3.320.0000.00613.21
7.3.310.0030.00316.20
7.3.300.0000.00616.34
7.3.290.0000.00716.39
7.3.280.0040.01116.36
7.3.260.0080.01116.36
7.3.240.0090.01016.40
7.3.230.0140.00316.67
7.3.210.0070.01016.45
7.3.200.0030.01916.39
7.3.190.0030.01316.62
7.3.180.0100.00616.66
7.3.170.0030.01416.39
7.3.160.0090.01216.42
7.3.120.0050.01215.05
7.3.110.0080.00914.92
7.3.100.0030.01215.01
7.3.90.0100.00314.81
7.3.80.0040.01114.96
7.3.70.0060.00714.83
7.3.60.0080.00514.95
7.3.50.0060.00815.02
7.3.40.0050.01214.76
7.3.30.0060.00814.81
7.3.20.0050.00716.70
7.3.10.0080.00416.67
7.3.00.0070.00916.51
7.2.330.0060.01616.75
7.2.320.0090.01616.48
7.2.310.0120.00616.79
7.2.300.0090.00616.50
7.2.290.0030.01616.55
7.2.250.0100.00915.25
7.2.240.0040.01615.27
7.2.230.0070.00614.96
7.2.220.0080.00615.18
7.2.210.0050.00815.16
7.2.200.0050.00915.02
7.2.190.0070.00615.00
7.2.180.0040.01015.05
7.2.170.0050.01115.10
7.2.160.0000.01414.82
7.2.150.0090.00616.75
7.2.140.0100.00617.05
7.2.130.0030.00616.70
7.2.120.0030.01317.01
7.2.110.0030.01016.91
7.2.100.0120.00316.58
7.2.90.0000.01917.03
7.2.80.0120.00417.07
7.2.70.0070.01116.99
7.2.60.0520.00715.89
7.2.50.0520.00615.97
7.2.40.0550.00516.21
7.2.30.0540.00616.20
7.2.20.0440.01016.10
7.2.10.0390.01016.05
7.2.00.0530.00816.22
7.1.330.0070.00715.90
7.1.320.0040.01115.91
7.1.310.0060.00715.75
7.1.300.0070.00815.95
7.1.290.0060.00815.83
7.1.280.0040.00915.89
7.1.270.0030.00915.82
7.1.260.0030.01015.71
7.1.250.0070.00716.03
7.1.240.0000.01515.86
7.1.230.0070.00415.49
7.1.220.0040.00815.63
7.1.210.0060.00915.65
7.1.200.0070.00815.78
7.1.190.0040.00415.58
7.1.180.0070.00415.81
7.1.170.0490.00714.88
7.1.160.0470.00816.38
7.1.150.0570.00716.36
7.1.140.0370.00616.23
7.1.130.0510.00516.29
7.1.120.0460.01116.50
7.1.110.0610.01115.97
7.1.100.0470.01316.06
7.1.90.0480.01315.88
7.1.80.0500.00816.08
7.1.70.0470.00915.72
7.1.60.0600.00724.70
7.1.50.0780.01424.46
7.1.40.0670.01024.14
7.1.30.0570.00924.32
7.1.20.0530.00824.19
7.1.10.0640.00815.18
7.1.00.0320.00815.28
7.0.330.0070.00715.37
7.0.320.0060.00315.41
7.0.310.0080.00815.34
7.0.300.0060.00315.52
7.0.290.0100.00615.45
7.0.280.0040.00815.28
7.0.270.0060.00615.53
7.0.260.0000.00815.55
7.0.250.0070.00715.49
7.0.240.0070.00715.31
7.0.230.0110.00415.59
7.0.220.0060.00615.45
7.0.210.0070.00415.40
7.0.200.0100.00715.41
7.0.190.0030.01715.18
7.0.180.0000.01415.19
7.0.170.0030.01015.24
7.0.160.0100.00315.60
7.0.150.0090.00615.53
7.0.140.0060.00615.62
7.0.130.0110.00015.55
7.0.120.0040.01115.28
7.0.110.0040.00815.52
7.0.100.0100.00615.61
7.0.90.0040.01115.25
7.0.80.0080.00315.21
7.0.70.0100.00315.50
7.0.60.0060.00615.53
7.0.50.0000.01115.39
7.0.40.0090.00013.35
7.0.30.0080.00813.55
7.0.20.0000.01313.52
7.0.10.0110.00413.35
7.0.00.0030.00613.42
5.6.400.0000.01814.76
5.6.390.0070.01014.70
5.6.380.0030.00914.64
5.6.370.0070.01114.79
5.6.360.0080.00314.61
5.6.350.0130.00314.10
5.6.340.0030.00914.45
5.6.330.0030.00914.47
5.6.320.0000.01114.24
5.6.310.0070.01114.46
5.6.300.0000.01014.24
5.6.290.0040.00714.72
5.6.280.0110.00614.66
5.6.270.0040.00814.52
5.6.260.0120.00614.48
5.6.250.0040.00714.55
5.6.240.0090.00014.78
5.6.230.0060.00614.47
5.6.220.0090.00614.26
5.6.210.0040.00714.51
5.6.200.0040.00914.40
5.6.190.0040.01114.21
5.6.180.0030.01014.63
5.6.170.0070.00714.25
5.6.160.0040.01214.33
5.6.150.0000.01414.67
5.6.140.0060.00614.36
5.6.130.0060.00614.74
5.6.120.0030.01214.11
5.6.110.0110.00314.30
5.6.100.0070.00414.21
5.6.90.0000.01414.38
5.6.80.0070.00314.26
5.6.70.0040.01214.04
5.6.60.0000.01314.26
5.6.50.0080.00314.24
5.6.40.0030.01214.62
5.6.30.0080.00514.72
5.6.20.0040.01114.17
5.6.10.0030.00714.57
5.6.00.0030.01014.54

preferences:
37.02 ms | 400 KiB | 5 Q