3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Matcher { private $patterns; public $callbacks; public function __construct() { $this->patterns = new SplQueue(); $this->callbacks = []; } public function with(array $pattern, callable $callback) { $this->patterns->enqueue($pattern); $this->callbacks[$this->patterns->key()] = $callback; } } $a = new Matcher(); $cb = function() { }; $a->with(['foo', 'bar'], $cb); $a->with(['foo2', 'bar2'], $cb); $a->with(['foo3', 'bar3'], $cb); var_dump($a->callbacks);

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.0040.01118.18
8.3.50.0120.00318.21
8.3.40.0070.00718.75
8.3.30.0040.01119.18
8.3.20.0040.00420.29
8.3.10.0040.00421.76
8.3.00.0060.00317.50
8.2.180.0150.00618.38
8.2.170.0090.00619.14
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00319.23
8.2.110.0070.00420.52
8.2.100.0070.00417.84
8.2.90.0040.00419.28
8.2.80.0090.00018.16
8.2.70.0030.00617.75
8.2.60.0080.00018.05
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0050.00219.82
8.2.20.0050.00217.80
8.2.10.0080.00018.24
8.2.00.0070.00018.36
8.1.280.0040.01125.92
8.1.270.0040.00420.38
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00722.60
8.1.230.0070.00420.98
8.1.220.0040.00418.77
8.1.210.0060.00319.04
8.1.200.0060.00317.35
8.1.190.0040.00417.66
8.1.180.0030.00618.10
8.1.170.0040.00418.70
8.1.160.0000.00818.87
8.1.150.0030.00318.85
8.1.140.0030.00617.46
8.1.130.0030.00317.94
8.1.120.0000.00717.39
8.1.110.0000.00917.40
8.1.100.0030.00317.44
8.1.90.0050.00217.47
8.1.80.0040.00317.43
8.1.70.0050.00317.41
8.1.60.0000.00817.59
8.1.50.0050.00217.42
8.1.40.0060.00317.53
8.1.30.0040.00417.55
8.1.20.0000.00717.57
8.1.10.0050.00317.43
8.1.00.0030.00517.43
8.0.300.0000.00719.89
8.0.290.0040.00417.05
8.0.280.0000.00718.23
8.0.270.0030.00317.25
8.0.260.0030.00317.15
8.0.250.0070.00016.95
8.0.240.0000.00716.95
8.0.230.0000.00716.91
8.0.220.0000.00716.77
8.0.210.0030.00316.79
8.0.200.0070.00016.88
8.0.190.0000.00816.91
8.0.180.0040.00416.94
8.0.170.0040.00416.96
8.0.160.0000.00717.00
8.0.150.0040.00416.81
8.0.140.0080.00016.80
8.0.130.0040.00413.33
8.0.120.0000.00816.77
8.0.110.0000.00716.95
8.0.100.0000.00716.91
8.0.90.0040.00416.98
8.0.80.0040.01116.96
8.0.70.0000.00716.99
8.0.60.0080.00017.02
8.0.50.0040.00417.01
8.0.30.0090.01117.15
8.0.20.0080.01217.40
8.0.10.0070.00016.95
8.0.00.0070.01216.56
7.4.330.0000.00715.05
7.4.320.0090.00016.58
7.4.300.0060.00016.49
7.4.290.0000.00716.49
7.4.280.0050.00216.50
7.4.270.0070.00016.61
7.4.260.0050.00216.39
7.4.250.0000.00716.39
7.4.240.0050.00216.53
7.4.230.0000.00716.51
7.4.220.0120.00616.66
7.4.210.0090.00616.52
7.4.200.0080.00016.71
7.4.160.0090.00616.25
7.4.150.0040.01317.40
7.4.140.0130.01117.86
7.4.130.0130.00716.47
7.4.120.0160.00516.50
7.4.110.0070.01016.51
7.4.100.0180.00316.46
7.4.90.0000.01716.49
7.4.80.0100.00719.39
7.4.70.0090.00916.50
7.4.60.0100.00716.47
7.4.50.0050.00316.54
7.4.40.0060.01116.58
7.4.30.0100.00716.58
7.4.00.0060.00914.73
7.3.330.0000.00513.36
7.3.320.0000.00513.10
7.3.310.0000.00716.27
7.3.300.0000.00716.38
7.3.290.0060.00716.37
7.3.280.0120.00816.37
7.3.270.0060.01117.40
7.3.260.0060.01216.72
7.3.250.0080.01216.59
7.3.240.0140.00316.52
7.3.230.0110.00816.40
7.3.210.0090.00916.49
7.3.200.0080.01216.31
7.3.190.0110.00616.44
7.3.180.0070.01016.68
7.3.170.0040.01316.39
7.3.160.0140.00316.48
7.3.120.0110.00714.77
7.3.110.0050.00814.93
7.3.100.0000.01714.64
7.3.90.0060.01014.68
7.3.80.0030.01414.65
7.3.70.0060.00614.60
7.3.60.0080.00414.95
7.3.50.0070.01014.89
7.3.40.0070.00414.78
7.3.30.0040.00414.79
7.3.20.0000.01516.64
7.3.10.0080.00716.50
7.3.00.0090.00716.67
7.2.330.0150.00316.68
7.2.320.0150.00616.46
7.2.310.0130.01016.59
7.2.300.0060.01116.57
7.2.290.0190.00416.50
7.2.250.0070.01014.86
7.2.240.0120.00914.99
7.2.230.0060.00915.19
7.2.220.0030.00615.09
7.2.210.0070.01115.12
7.2.200.0070.00715.05
7.2.190.0040.01414.72
7.2.180.0070.00715.02
7.2.170.0070.00714.77
7.2.130.0150.00416.63
7.2.120.0100.00716.86
7.2.110.0100.00717.07
7.2.100.0110.01117.02
7.2.90.0100.01017.02
7.2.80.0110.00717.14
7.2.70.0150.00616.68
7.2.60.0080.00616.85
7.2.50.0190.00316.65
7.2.40.0000.01116.62
7.2.30.0130.00316.86
7.2.20.0090.00916.67
7.2.10.0070.00316.60
7.2.00.0090.00718.16
7.1.330.0030.01015.98
7.1.320.0100.00315.71
7.1.310.0110.00415.57
7.1.300.0030.01015.59
7.1.290.0080.00815.83
7.1.280.0060.00915.64
7.1.270.0100.00315.95
7.1.260.0000.01415.88
7.1.250.0120.00615.85
7.1.200.0040.01115.67
7.1.100.0090.00917.87
7.1.70.0040.00417.29
7.1.60.0090.01519.50
7.1.50.0040.01916.97
7.1.00.0000.08022.52
7.0.200.0030.00916.84
7.0.60.0230.07719.93
7.0.50.0070.08717.85
7.0.40.0100.06020.26
7.0.30.0500.04720.26
7.0.20.0230.08020.12
7.0.10.0100.03720.19
7.0.00.0100.04020.12
5.6.280.0030.07320.96
5.6.210.0000.05020.73
5.6.200.0130.08018.25
5.6.190.0000.04720.33
5.6.180.4130.04020.48
5.6.170.0300.06720.50
5.6.160.0070.05020.50
5.6.150.0000.05718.18
5.6.140.0130.07318.17
5.6.130.0030.09018.19
5.6.120.0100.07720.99
5.6.110.0130.05321.00
5.6.100.0000.07021.01
5.6.90.0000.04321.09
5.6.80.0070.04720.43
5.5.350.0300.06320.47
5.5.340.0100.08017.98
5.5.330.0200.07020.19
5.5.320.4070.03720.24
5.5.310.0230.05020.34
5.5.300.0030.03717.98
5.5.290.0070.04317.95
5.5.280.0130.04320.91
5.5.270.0070.08720.87
5.5.260.0270.05720.67
5.5.250.0100.08020.79
5.5.240.0100.04020.24
5.4.450.0230.04319.52
5.4.440.0570.07019.47
5.4.430.0300.03319.13
5.4.420.0230.04319.46
5.4.410.0130.06018.93
5.4.400.0070.07018.54
5.4.390.0130.05318.72
5.4.380.0200.05018.63
5.4.370.0130.05018.77
5.4.360.0130.05018.75
5.4.350.0170.04718.70
5.4.340.0070.05318.51
5.4.320.0200.04318.53
5.4.310.0100.05318.77
5.4.300.0100.05718.77
5.4.290.0100.05018.46
5.4.280.0070.05718.80
5.4.270.0230.04018.82
5.4.260.0170.05318.60
5.4.250.0100.07718.57
5.4.240.0130.06018.62
5.4.230.0030.05718.52
5.4.220.0230.04018.75
5.4.210.0170.04718.79
5.4.200.0130.05016.68
5.4.190.0100.05318.67
5.4.180.0070.05318.80
5.4.170.0130.05018.53
5.4.160.0230.06018.70
5.4.150.0070.05718.71
5.4.140.0170.06316.30
5.4.130.0070.05316.21
5.4.120.0130.04716.43
5.4.110.0070.05316.32
5.4.100.0070.05716.34
5.4.90.0100.05716.17
5.4.80.0170.05016.25
5.4.70.0030.06016.26
5.4.60.0070.06016.26
5.4.50.0000.05316.26
5.4.40.0070.05716.23
5.4.30.0100.04716.30
5.4.20.0100.06716.38
5.4.10.0130.04716.20
5.4.00.0100.04715.74
5.3.290.0030.06014.88
5.3.280.0070.05714.63
5.3.270.0030.06314.73
5.3.260.0130.06014.73
5.3.250.0000.06314.79
5.3.240.0130.06314.73
5.3.230.0200.05714.70
5.3.220.0170.07314.70
5.3.210.0100.05314.73
5.3.200.0070.05314.77
5.3.190.0100.05314.75
5.3.180.0100.07314.58
5.3.170.0200.06314.77
5.3.160.0130.06014.54
5.3.150.0170.04714.61
5.3.140.0130.05014.58
5.3.130.0070.06014.53
5.3.120.0070.06014.60
5.3.110.0170.06014.54
5.3.100.0100.06014.06
5.3.90.0070.05314.07
5.3.80.0100.06314.06
5.3.70.0100.05314.04
5.3.60.0130.05014.07
5.3.50.0130.04714.01
5.3.40.0230.04713.99
5.3.30.0100.05714.02
5.3.20.0100.04713.73
5.3.10.0130.04713.88
5.3.00.0070.07013.73
5.2.170.0070.04311.19
5.2.160.0100.03711.21
5.2.150.0070.04711.25
5.2.140.0070.04711.20
5.2.130.0070.04311.16
5.2.120.0030.04311.23
5.2.110.0070.04311.23
5.2.100.0070.04011.14
5.2.90.0130.03711.21
5.2.80.0070.04711.14
5.2.70.0100.04011.22
5.2.60.0070.05311.17
5.2.50.0030.04711.13
5.2.40.0070.04011.12
5.2.30.0100.05311.02
5.2.20.0130.04010.96
5.2.10.0070.04311.04
5.2.00.0100.04010.77
5.1.60.0070.03310.07
5.1.50.0130.04310.20
5.1.40.0070.04710.10
5.1.30.0100.04710.35
5.1.20.0130.05710.46
5.1.10.0070.03710.07
5.1.00.0130.03010.11
5.0.50.0000.0338.67
5.0.40.0030.0308.48
5.0.30.0100.0438.33
5.0.20.0070.0278.32
5.0.10.0130.0308.29
5.0.00.0070.0438.20
4.4.90.0030.0236.00
4.4.80.0070.0206.00
4.4.70.0000.0276.00
4.4.60.0070.0205.90
4.4.50.0170.0135.92
4.4.40.0070.0335.86
4.4.30.0070.0206.01
4.4.20.0070.0205.95
4.4.10.0030.0235.93
4.4.00.0030.0376.04
4.3.110.0030.0305.89
4.3.100.0000.0275.82
4.3.90.0030.0235.81
4.3.80.0000.0375.91
4.3.70.0070.0205.87
4.3.60.0130.0135.80
4.3.50.0100.0175.78
4.3.40.0100.0305.75
4.3.30.0100.0174.60
4.3.20.0070.0234.53
4.3.10.0030.0234.48
4.3.00.0030.01315.42

preferences:
50.75 ms | 400 KiB | 5 Q