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"; foreach(array(100) as $base) { sM::addMethod('add'.$base, function($self, $number) use ($base) { return $self->add($number, $base); }); } 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.40.0110.00419.01
8.3.30.0090.00618.79
8.3.20.0070.00019.32
8.3.10.0070.00019.16
8.3.00.0090.00017.90
8.2.170.0030.01022.96
8.2.160.0140.00020.57
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0030.00519.89
8.2.120.0040.00426.35
8.2.110.0070.00419.39
8.2.100.0090.00317.83
8.2.90.0090.00017.91
8.2.80.0050.00317.97
8.2.70.0040.00417.93
8.2.60.0050.00318.16
8.2.50.0030.00518.10
8.2.40.0050.00321.19
8.2.30.0000.00719.51
8.2.20.0040.00417.99
8.2.10.0050.00218.00
8.2.00.0070.00019.51
8.1.270.0030.00523.84
8.1.260.0080.00026.35
8.1.250.0140.00328.09
8.1.240.0030.00621.43
8.1.230.0040.00720.84
8.1.220.0030.00617.74
8.1.210.0060.00318.83
8.1.200.0030.00717.00
8.1.190.0000.00817.34
8.1.180.0050.00318.10
8.1.170.0000.00918.37
8.1.160.0050.00218.82
8.1.150.0040.00418.81
8.1.140.0040.00417.70
8.1.130.0030.00319.09
8.1.120.0090.00017.41
8.1.110.0030.00617.47
8.1.100.0040.00417.36
8.1.90.0050.00317.37
8.1.80.0000.00717.43
8.1.70.0000.00717.37
8.1.60.0030.00717.45
8.1.50.0040.00417.41
8.1.40.0030.00617.41
8.1.30.0040.00417.70
8.1.20.0070.00017.56
8.1.10.0040.00417.64
8.1.00.0090.00017.59
8.0.300.0040.00419.79
8.0.290.0050.00316.63
8.0.280.0030.00318.41
8.0.270.0030.00517.14
8.0.260.0000.00617.29
8.0.250.0030.00517.09
8.0.240.0000.00917.01
8.0.230.0000.00717.00
8.0.220.0000.00816.91
8.0.210.0070.00017.00
8.0.200.0040.00416.96
8.0.190.0090.00016.93
8.0.180.0070.00016.99
8.0.170.0040.00417.05
8.0.160.0000.00717.04
8.0.150.0000.01016.80
8.0.140.0000.00716.86
8.0.130.0030.00313.44
8.0.120.0000.00816.96
8.0.110.0040.00416.81
8.0.100.0000.00817.09
8.0.90.0040.00416.96
8.0.80.0080.00816.95
8.0.70.0050.00316.88
8.0.60.0040.00416.91
8.0.50.0070.00016.83
8.0.30.0080.01117.23
8.0.20.0100.00917.40
8.0.10.0000.00716.93
8.0.00.0110.00716.69
7.4.330.0060.00015.55
7.4.320.0030.00316.60
7.4.300.0000.00816.63
7.4.290.0040.00416.47
7.4.280.0040.00416.63
7.4.270.0030.00316.60
7.4.260.0040.00416.50
7.4.250.0050.00216.50
7.4.240.0000.00816.48
7.4.230.0030.00316.42
7.4.220.0000.00816.53
7.4.210.0060.00816.54
7.4.200.0000.00716.41
7.4.160.0100.00716.57
7.4.140.0140.00617.86
7.4.130.0110.00616.50
7.4.120.0100.01016.53
7.4.110.0080.00816.56
7.4.100.0060.01016.60
7.4.90.0140.01016.50
7.4.80.0120.01219.39
7.4.70.0040.01216.60
7.4.60.0070.01016.71
7.4.50.0090.00616.30
7.4.40.0200.00316.55
7.4.00.0070.00714.93
7.3.330.0040.00213.42
7.3.320.0000.00513.44
7.3.310.0000.00716.47
7.3.300.0070.00016.46
7.3.290.0040.00416.40
7.3.280.0060.00916.46
7.3.260.0120.00716.51
7.3.240.0110.00816.60
7.3.230.0100.01016.44
7.3.210.0130.00316.71
7.3.200.0100.01016.40
7.3.190.0060.01016.43
7.3.180.0090.00916.58
7.3.170.0150.00316.46
7.3.160.0030.01316.62
7.3.120.0120.00714.93
7.3.110.0110.00514.85
7.3.100.0080.00914.87
7.3.90.0060.01014.72
7.3.80.0100.00515.09
7.3.70.0060.00814.71
7.3.60.0050.00814.86
7.3.50.0050.00914.73
7.3.40.0050.01014.95
7.3.30.0070.00714.89
7.3.20.0040.00716.64
7.3.10.0080.00616.77
7.3.00.0080.00916.46
7.2.330.0120.00616.79
7.2.320.0070.01016.72
7.2.310.0120.00916.77
7.2.300.0070.01016.70
7.2.290.0110.01116.80
7.2.250.0040.01415.16
7.2.240.0060.01215.01
7.2.230.0060.01014.90
7.2.220.0060.00715.01
7.2.210.0110.00415.29
7.2.200.0060.00915.13
7.2.190.0070.00615.06
7.2.180.0040.00714.95
7.2.170.0070.01015.06
7.2.160.0080.00815.20
7.2.150.0070.01116.97
7.2.140.0060.00616.89
7.2.130.0110.00716.67
7.2.120.0110.00916.79
7.2.110.0070.01416.69
7.2.100.0030.01116.66
7.2.90.0140.00616.65
7.2.80.0100.01016.69
7.2.70.0090.01216.76
7.2.60.0460.00816.37
7.2.50.0470.01116.19
7.2.40.0440.01116.32
7.2.30.0500.00916.19
7.2.20.0430.00816.29
7.2.10.0490.01016.31
7.2.00.0560.00716.53
7.1.330.0060.00815.96
7.1.320.0070.00715.85
7.1.310.0040.01015.87
7.1.300.0070.00915.74
7.1.290.0050.01015.74
7.1.280.0040.01115.65
7.1.270.0030.01215.63
7.1.260.0080.00615.92
7.1.250.0110.00515.66
7.1.200.0000.01615.71
7.1.170.1280.00713.86
7.1.160.1030.01017.04
7.1.150.1890.01016.54
7.1.140.1510.01116.79
7.1.130.1560.01117.02
7.1.120.1230.01316.87
7.1.110.1510.01116.02
7.1.100.0880.00916.18
7.1.90.1400.00716.13
7.1.80.1090.01116.04
7.1.70.1180.00815.47
7.1.60.1300.01333.30
7.1.50.1570.01732.87
7.1.40.1470.01032.37
7.1.30.1390.01232.54
7.1.20.1210.01332.76
7.1.10.1190.01314.80
7.1.00.1070.01014.82

preferences:
47.98 ms | 400 KiB | 5 Q