3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Inflector { private $methods = []; public function __construct(array $methods) { $this->methods = $methods; //var_dump($this->methods); } public function __call(string $methodName, $test) { if (isset($this->methods[$methodName])) { return $this->methods[$methodName]($test); } throw new InflectionDeceptionException(); } } class InflectionDeceptionException extends \Exception { public function __construct($message = "Say what?") { return parent::__construct($message); } } $a = new Inflector([ 'foo' => function($val){echo sprintf('%s calls foo()', $val[0] ?? 'none!').PHP_EOL;}, 'bar' => function($val){echo sprintf('%s calls bar()', $val[0] ?? 'none!').PHP_EOL;}, 'baz' => function($val){echo sprintf('%s calls baz()', $val[0] ?? 'none!').PHP_EOL;}, ]); $a->foo('Ahnold'); $a->bar('Elvis'); $a->baz('Lerhman'); $a->theBreaks('Who');

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.5.10.0090.00916.92
8.5.00.0140.00920.38
8.4.150.0030.00014.05
8.4.140.0100.01217.93
8.4.130.0110.01017.86
8.4.120.0110.00920.64
8.4.110.0070.01422.53
8.4.100.0060.00318.05
8.4.90.0110.00918.86
8.4.80.0110.01119.83
8.4.70.0040.00419.81
8.4.60.0150.00418.74
8.4.50.0150.00618.63
8.4.40.0090.00017.84
8.4.30.0060.01319.59
8.4.20.0160.00719.48
8.4.10.0100.01019.69
8.3.280.0100.01118.53
8.3.270.0110.00916.63
8.3.260.0050.00316.95
8.3.250.0140.00518.72
8.3.240.0080.00716.98
8.3.230.0120.00816.67
8.3.220.0060.00219.08
8.3.210.0090.00920.77
8.3.200.0140.00616.68
8.3.190.0070.00417.12
8.3.180.0080.00718.74
8.3.170.0110.00718.33
8.3.160.0120.00616.98
8.3.150.0120.00318.91
8.3.140.0030.00618.89
8.3.130.0030.00518.48
8.3.120.0060.00318.87
8.3.110.0080.00818.40
8.3.100.0150.00318.49
8.3.90.0070.01316.89
8.3.80.0110.00018.55
8.3.70.0130.01016.50
8.3.60.0160.00316.88
8.3.50.0100.00917.55
8.3.40.0110.00418.70
8.3.30.0000.01518.79
8.3.20.0050.00221.90
8.3.10.0000.00923.53
8.3.00.0070.00022.22
8.2.290.0070.00420.41
8.2.280.0090.00718.73
8.2.270.0070.01122.06
8.2.260.0120.00616.92
8.2.250.0080.00016.65
8.2.240.0070.01119.02
8.2.230.0030.00620.94
8.2.220.0070.01024.06
8.2.210.0140.00326.77
8.2.200.0050.00516.63
8.2.190.0090.00616.75
8.2.180.0160.00018.38
8.2.170.0120.00322.96
8.2.160.0040.01120.21
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.01120.95
8.2.120.0070.00026.35
8.2.110.0060.00322.07
8.2.100.0070.00417.84
8.2.90.0000.00818.03
8.2.80.0000.00819.36
8.2.70.0030.00517.93
8.2.60.0000.00917.80
8.2.50.0100.00018.34
8.2.40.0000.00822.34
8.2.30.0000.00819.62
8.2.20.0040.00418.20
8.2.10.0030.00618.13
8.2.00.0060.00319.78
8.1.330.0140.00522.13
8.1.320.0110.00817.88
8.1.310.0060.00316.66
8.1.300.0070.00319.92
8.1.290.0090.00018.88
8.1.280.0130.01025.92
8.1.270.0080.00023.95
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0050.00520.87
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0090.00017.48
8.1.190.0060.00317.25
8.1.180.0080.00018.10
8.1.170.0050.00318.71
8.1.160.0070.00018.82
8.1.150.0000.00720.21
8.1.140.0040.00417.72
8.1.130.0080.00319.03
8.1.120.0060.00317.53
8.1.110.0040.00417.38
8.1.100.0040.00417.40
8.1.90.0000.00817.49
8.1.80.0000.00717.51
8.1.70.0030.00317.45
8.1.60.0000.00817.60
8.1.50.0040.00417.40
8.1.40.0040.00417.43
8.1.30.0030.00517.54
8.1.20.0060.00317.67
8.1.10.0000.00817.48
8.1.00.0000.00917.42
8.0.300.0040.00420.16
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0040.00417.22
8.0.260.0080.00016.94
8.0.250.0040.00417.03
8.0.240.0080.00016.90
8.0.230.0040.00416.97
8.0.220.0030.00616.95
8.0.210.0050.00216.95
8.0.200.0000.00717.02
8.0.190.0040.00416.91
8.0.180.0000.00817.02
8.0.170.0060.00316.92
8.0.160.0000.00717.01
8.0.150.0070.00016.89
8.0.140.0000.00716.80
8.0.130.0050.00013.34
8.0.120.0030.00516.83
8.0.110.0050.00216.92
8.0.100.0030.00516.81
8.0.90.0040.00416.96
8.0.80.0050.01016.89
8.0.70.0040.00416.84
8.0.60.0000.00816.93
8.0.50.0000.00716.82
8.0.30.0100.00817.19
8.0.20.0130.00817.40
8.0.10.0000.00716.89
8.0.00.0110.00916.90
7.4.330.0030.00315.55
7.4.320.0030.00316.51
7.4.300.0000.00716.63
7.4.290.0040.00416.55
7.4.280.0050.00516.60
7.4.270.0000.00716.59
7.4.260.0030.00316.59
7.4.250.0030.00316.48
7.4.240.0070.00016.50
7.4.230.0060.00316.70
7.4.220.0000.00816.39
7.4.210.0030.01716.46
7.4.200.0070.00016.34
7.4.160.0120.00616.47
7.4.140.0140.00717.86
7.4.130.0090.00916.45
7.4.120.0110.00916.48
7.4.110.0150.00316.47
7.4.100.0070.01016.35
7.4.90.0140.00416.46
7.4.80.0070.01719.39
7.4.70.0090.00916.55
7.4.60.0090.00616.47
7.4.50.0070.00716.67
7.4.40.0070.01116.58
7.4.00.0060.00914.95
7.3.330.0050.00013.46
7.3.320.0000.00613.51
7.3.310.0030.00316.30
7.3.300.0000.00716.31
7.3.290.0090.00716.46
7.3.280.0080.00816.42
7.3.260.0090.01116.44
7.3.240.0040.01316.57
7.3.230.0120.00616.41
7.3.210.0130.00316.39
7.3.200.0120.00416.57
7.3.190.0110.01116.27
7.3.180.0130.00316.43
7.3.170.0140.00316.59
7.3.160.0110.00616.45
7.2.330.0090.00916.88
7.2.320.0060.01216.89
7.2.310.0040.01716.46
7.2.300.0090.00616.48
7.2.290.0070.01116.75
7.2.60.0040.00716.84
7.2.30.0120.01618.17
7.2.20.0130.01718.09
7.2.10.0130.01418.22
7.2.00.0440.01518.22
7.1.200.0060.00315.89
7.1.150.1130.01417.23
7.1.140.0090.01616.78
7.1.130.0120.01516.81
7.1.120.0120.01616.96
7.1.110.0130.00616.57
7.1.100.0080.01116.23
7.1.90.0070.01316.18
7.1.80.0140.01216.00
7.1.70.0060.01515.30
7.1.60.0320.01133.38
7.1.50.0270.01232.97
7.1.40.0310.01732.63
7.1.30.0270.01432.68
7.1.20.0280.01333.00
7.1.10.0110.00815.03
7.1.00.0110.01614.92

preferences:
42.2 ms | 403 KiB | 5 Q