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) 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.00716.75
8.3.50.0070.00716.15
8.3.40.0110.00418.71
8.3.30.0090.00618.84
8.3.20.0080.00019.27
8.3.10.0040.00419.19
8.3.00.0040.00418.04
8.2.180.0100.01016.63
8.2.170.0070.00722.96
8.2.160.0140.00020.79
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00819.89
8.2.120.0060.00326.35
8.2.110.0060.00320.86
8.2.100.0060.00917.84
8.2.90.0040.00417.75
8.2.80.0040.00417.97
8.2.70.0080.00018.04
8.2.60.0050.00317.93
8.2.50.0000.00818.10
8.2.40.0000.00821.10
8.2.30.0040.00419.51
8.2.20.0000.00718.05
8.2.10.0000.00818.23
8.2.00.0000.00819.40
8.1.280.0000.01525.92
8.1.270.0080.00023.89
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0040.00422.29
8.1.230.0070.00319.13
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0040.00417.36
8.1.190.0060.00317.23
8.1.180.0000.00818.10
8.1.170.0000.01118.59
8.1.160.0000.00718.87
8.1.150.0040.00418.81
8.1.140.0050.00217.73
8.1.130.0030.00317.39
8.1.120.0060.00317.51
8.1.110.0000.00717.48
8.1.100.0070.00017.37
8.1.90.0000.00717.48
8.1.80.0000.00717.37
8.1.70.0070.00017.46
8.1.60.0030.00617.60
8.1.50.0030.00617.55
8.1.40.0040.00417.55
8.1.30.0000.00817.70
8.1.20.0050.00317.57
8.1.10.0040.00417.55
8.1.00.0000.00817.41
8.0.300.0040.00421.51
8.0.290.0040.00416.75
8.0.280.0040.00418.48
8.0.270.0030.00517.20
8.0.260.0030.00316.92
8.0.250.0000.00717.02
8.0.240.0050.00317.09
8.0.230.0000.00816.94
8.0.220.0020.00516.90
8.0.210.0030.00416.88
8.0.200.0030.00316.96
8.0.190.0040.00417.04
8.0.180.0090.00017.02
8.0.170.0040.00417.06
8.0.160.0030.00516.92
8.0.150.0060.00316.96
8.0.140.0000.00716.94
8.0.130.0030.00313.34
8.0.120.0040.00416.93
8.0.110.0040.00416.87
8.0.100.0080.00016.84
8.0.90.0000.00816.85
8.0.80.0120.00716.99
8.0.70.0050.00216.83
8.0.60.0040.00416.87
8.0.50.0000.00717.00
8.0.30.0110.00717.22
8.0.20.0070.01417.40
8.0.10.0050.00217.14
8.0.00.0160.00216.91
7.4.330.0050.00015.55
7.4.320.0030.00316.49
7.4.300.0000.00716.51
7.4.290.0000.00716.62
7.4.280.0000.00816.51
7.4.270.0040.00416.52
7.4.260.0040.00416.51
7.4.250.0000.00716.47
7.4.240.0030.00616.46
7.4.230.0000.00716.33
7.4.220.0040.00416.45
7.4.210.0080.00716.56
7.4.200.0000.00816.74
7.4.160.0050.01116.61
7.4.140.0110.00717.86
7.4.130.0100.00716.68
7.4.120.0130.00816.57
7.4.110.0040.01316.68
7.4.100.0100.00716.52
7.4.90.0140.00716.61
7.4.80.0160.00719.39
7.4.70.0030.01316.60
7.4.60.0130.01016.44
7.4.50.0040.01516.64
7.4.40.0030.01416.54
7.4.00.0080.00415.27
7.3.330.0070.00013.31
7.3.320.0060.00013.45
7.3.310.0030.00316.34
7.3.300.0060.00016.48
7.3.290.0030.00316.46
7.3.280.0060.01216.45
7.3.260.0130.00916.45
7.3.240.0120.00716.50
7.3.230.0070.01016.49
7.3.210.0060.01816.57
7.3.200.0100.01016.43
7.3.190.0080.00916.67
7.3.180.0100.00616.41
7.3.170.0070.01116.64
7.3.160.0030.01316.41
7.2.330.0070.01116.83
7.2.320.0070.01716.82
7.2.310.0130.01016.80
7.2.300.0110.00616.43
7.2.290.0140.00616.73
7.2.60.2350.00914.95
7.2.50.1170.00815.22
7.2.40.0850.01115.61
7.2.30.0820.00915.39
7.2.20.0980.00815.49
7.2.10.1000.01215.39
7.2.00.1020.00815.64
7.1.200.0100.00315.83
7.1.170.0950.00413.78
7.1.160.0790.01116.64
7.1.150.0770.00916.79
7.1.140.1080.01016.94
7.1.130.0790.00916.57
7.1.120.1220.00716.78
7.1.110.0700.01015.80
7.1.100.0710.01016.06
7.1.90.1070.01116.17
7.1.80.0910.01016.08
7.1.70.0780.00915.40
7.1.60.1520.01633.12
7.1.50.1260.01332.92
7.1.40.1140.01632.75
7.1.30.1240.01932.42
7.1.20.1620.01732.76
7.1.10.1180.00814.80
7.1.00.1380.01314.84

preferences:
50.81 ms | 401 KiB | 5 Q