3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matchesMatches = function ($matches) { //$m = 1; //yield $m; // could put as a `for` so it is more optimized, but for now, that is premature optimization foreach ($matches as $match) { // var_dump($match); // yeild $m; for ($i = 1; $i <= 3; $i++) { // Note that $i is preserved between yields. yield $i; } } }; $matches = [1,2, 3]; $matches = [1 => array('a', 'b'), 2 => array('c', 'd'), 3 => array('e', 'f')]; foreach ($matchesMatches($matches) as $m) { var_dump($m); }

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.0160.00316.75
8.3.50.0080.01021.98
8.3.40.0110.00418.63
8.3.30.0100.00719.17
8.3.20.0000.00720.21
8.3.10.0030.00521.73
8.3.00.0000.00820.95
8.2.180.0120.00816.38
8.2.170.0070.01422.96
8.2.160.0100.00722.20
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0150.00019.83
8.2.110.0090.00022.26
8.2.100.0090.00317.63
8.2.90.0040.00419.28
8.2.80.0060.00317.97
8.2.70.0080.00017.63
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0060.00318.16
8.2.30.0000.00818.07
8.2.20.0030.00517.70
8.2.10.0040.00418.11
8.2.00.0050.00317.67
8.1.280.0030.01025.92
8.1.270.0040.00418.86
8.1.260.0040.00426.35
8.1.250.0110.00328.09
8.1.240.0090.00023.83
8.1.230.0040.00719.03
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0070.00317.25
8.1.190.0080.00017.38
8.1.180.0080.00018.10
8.1.170.0000.00818.48
8.1.160.0050.00222.02
8.1.150.0040.00418.79
8.1.140.0050.00217.44
8.1.130.0000.00717.88
8.1.120.0040.00417.48
8.1.110.0000.00817.49
8.1.100.0070.00017.46
8.1.90.0090.00017.43
8.1.80.0040.00317.35
8.1.70.0000.00717.34
8.1.60.0000.00817.62
8.1.50.0040.00417.42
8.1.40.0060.00317.42
8.1.30.0030.00517.56
8.1.20.0000.00817.67
8.1.10.0030.00617.54
8.1.00.0000.00917.48
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0000.00717.24
8.0.260.0060.00017.37
8.0.250.0000.00716.98
8.0.240.0000.00816.85
8.0.230.0040.00316.98
8.0.220.0070.00016.86
8.0.210.0040.00416.80
8.0.200.0000.00716.93
8.0.190.0050.00317.01
8.0.180.0030.00316.93
8.0.170.0060.00316.80
8.0.160.0040.00416.88
8.0.150.0050.00216.79
8.0.140.0000.00716.85
8.0.130.0030.00313.41
8.0.120.0040.00416.84
8.0.110.0040.00416.92
8.0.100.0000.00716.88
8.0.90.0040.00416.91
8.0.80.0040.01416.80
8.0.70.0070.00016.92
8.0.60.0000.00917.00
8.0.50.0080.00016.89
8.0.30.0180.00717.03
8.0.20.0120.01717.40
8.0.10.0000.00717.00
8.0.00.0090.00916.73
7.4.330.0030.00315.03
7.4.320.0000.00716.60
7.4.300.0000.00616.64
7.4.290.0000.00716.36
7.4.280.0000.01016.61
7.4.270.0060.00016.45
7.4.260.0060.00316.53
7.4.250.0030.00516.46
7.4.240.0040.00416.56
7.4.230.0030.00316.41
7.4.220.0070.01116.51
7.4.210.0150.00616.53
7.4.200.0030.00316.68
7.4.160.0040.01216.38
7.4.150.0120.01517.40
7.4.140.0110.00817.86
7.4.130.0090.00816.46
7.4.120.0060.01516.58
7.4.110.0090.01016.50
7.4.100.0090.01516.55
7.4.90.0120.00616.45
7.4.80.0030.02016.49
7.4.70.0060.01216.53
7.4.60.0100.00616.38
7.4.50.0030.00316.29
7.4.40.0030.01416.58
7.4.30.0090.00616.78
7.4.00.0060.00914.95
7.3.330.0030.00313.22
7.3.320.0160.00013.32
7.3.310.0030.00516.23
7.3.300.0030.00316.32
7.3.290.0120.00416.37
7.3.280.0090.00916.29
7.3.270.0140.01017.40
7.3.260.0100.00716.49
7.3.250.0120.00916.56
7.3.240.0100.01016.61
7.3.230.0060.01316.39
7.3.210.0120.00416.45
7.3.200.0030.01819.39
7.3.190.0060.01316.40
7.3.180.0070.00716.63
7.3.170.0130.01016.44
7.3.160.0100.00716.54
7.3.10.0070.01016.59
7.3.00.0100.00516.38
7.2.330.0030.01316.63
7.2.320.0090.00916.71
7.2.310.0200.02916.73
7.2.300.0160.00016.34
7.2.290.0070.01016.52
7.2.130.0110.00516.68
7.2.120.0150.00516.64
7.2.110.0080.00616.71
7.2.100.0070.00716.70
7.2.90.0060.00716.66
7.2.80.0100.00616.75
7.2.70.0080.00816.77
7.2.60.0070.00716.71
7.2.50.0110.00716.75
7.2.40.0110.00616.55
7.2.30.0080.01016.69
7.2.20.0090.00916.81
7.2.10.0080.00916.54
7.2.00.0090.00616.76
7.1.250.0110.00615.55
7.1.100.0000.01117.87
7.1.70.0040.00717.01
7.1.60.0070.01719.46
7.1.50.0030.01616.91
7.1.00.0030.07322.30
7.0.200.0140.00715.00
7.0.140.0030.07022.21
7.0.60.0130.08020.04
7.0.50.0170.07717.88
7.0.40.0070.07720.24
7.0.30.0400.04720.16
7.0.20.0200.05020.09
7.0.10.0370.07720.18
7.0.00.0130.05020.05
5.6.280.0030.07020.99
5.6.210.0070.08320.50
5.6.200.0170.07018.16
5.6.190.0030.04020.57
5.6.180.3330.04020.68
5.6.170.0370.07020.57
5.6.160.0070.08020.52
5.6.150.0100.03018.17
5.6.140.0100.03718.18
5.6.130.0000.04718.17
5.6.120.0030.04321.05
5.6.110.0070.03720.98
5.6.100.0070.07321.14
5.6.90.0100.08320.85
5.6.80.0130.04020.38
5.6.70.0230.03720.41
5.5.350.0400.05320.30
5.5.340.0100.04018.09
5.5.330.0100.08320.21
5.5.320.0430.07320.42
5.5.310.0170.04320.35
5.5.300.0030.09017.97
5.5.290.0070.08718.05
5.5.280.0070.08320.89
5.5.270.0130.05020.78
5.5.260.0100.08320.77
5.5.250.0100.07720.78
5.5.240.0330.06720.16
5.4.450.0100.06319.45
5.4.440.1370.08019.34
5.4.430.1230.04719.55
5.4.420.0900.05319.63
5.4.410.1000.05019.06
5.4.400.1170.05019.30
5.4.390.0100.05718.75
5.4.380.0170.07318.73
5.4.370.0100.07718.82
5.4.360.0200.06318.73
5.4.350.0100.07718.48
5.4.340.0200.06318.53
5.4.320.0130.06318.77
5.4.310.0270.05718.74
5.4.300.0030.06318.70
5.4.290.0130.05318.56
5.4.280.0230.04318.50
5.4.270.0170.07018.76
5.4.260.0200.06318.74
5.4.250.0230.06718.53
5.4.240.0100.06018.83
5.4.230.0130.05318.60
5.4.220.0130.05718.77
5.4.210.0270.05718.60
5.4.200.0170.04716.78
5.4.190.0030.06318.45
5.4.180.0100.05318.59
5.4.170.0100.05718.44
5.4.160.0070.05718.79
5.4.150.0130.05318.71
5.4.140.0100.05716.34
5.4.130.0100.05016.25
5.4.120.0170.04716.26
5.4.110.0070.05316.32
5.4.100.0130.05016.29
5.4.90.0070.05716.18
5.4.80.0230.04016.27
5.4.70.0130.06716.23
5.4.60.0170.04716.18
5.4.50.0070.05316.23
5.4.40.0100.05316.42
5.4.30.0100.05016.29
5.4.20.0070.05716.21
5.4.10.0130.05016.23
5.4.00.0270.04315.64
5.3.290.0130.06314.71
5.3.280.0070.06014.68
5.3.270.0130.05714.76
5.3.260.0170.05714.66
5.3.250.0100.05314.72
5.3.240.0170.06714.64
5.3.230.0170.06714.62
5.3.220.0070.06314.62
5.3.210.0070.08014.73
5.3.200.0100.05314.78
5.3.190.0200.04314.57
5.3.180.0070.05714.77
5.3.170.0070.05714.62
5.3.160.0130.05314.61
5.3.150.0100.05314.65
5.3.140.0130.05014.64
5.3.130.0130.05014.57
5.3.120.0130.05014.52
5.3.110.0100.05314.60
5.3.100.0130.04714.08
5.3.90.0170.04714.11
5.3.80.0100.05014.05
5.3.70.0130.05014.21
5.3.60.0100.05014.06
5.3.50.0130.06713.93
5.3.40.0170.05014.00
5.3.30.0100.05013.94
5.3.20.0170.06013.73
5.3.10.0200.06013.87
5.3.00.0100.05013.66
5.2.170.0070.04311.18
5.2.160.0030.04711.17
5.2.150.0070.04311.27
5.2.140.0070.04311.16
5.2.130.0130.05311.01
5.2.120.0130.05011.24
5.2.110.0170.03311.08
5.2.100.0100.04011.23
5.2.90.0100.04011.04
5.2.80.0170.03311.05
5.2.70.0130.03711.14
5.2.60.0070.04311.02
5.2.50.0130.04010.96
5.2.40.0070.04311.11
5.2.30.0130.03710.88
5.2.20.0000.04710.87
5.2.10.0030.04310.83
5.2.00.0170.03310.76
5.1.60.0130.0309.99
5.1.50.0030.0439.97
5.1.40.0030.0379.91
5.1.30.0070.03710.45
5.1.20.0100.04710.37
5.1.10.0100.03010.06
5.1.00.0030.04010.04
5.0.50.0070.0278.63
5.0.40.0130.0208.47
5.0.30.0030.0478.17
5.0.20.0030.0308.36
5.0.10.0070.0278.34
5.0.00.0070.0438.34
4.4.90.0100.0175.91
4.4.80.0070.0275.81
4.4.70.0130.0205.94
4.4.60.0030.0305.90
4.4.50.0030.0305.90
4.4.40.0100.0405.91
4.4.30.0100.0235.91
4.4.20.0030.0235.96
4.4.10.0070.0235.97
4.4.00.0070.0335.90
4.3.110.0030.0235.83
4.3.100.0100.0235.82
4.3.90.0070.0275.79
4.3.80.0030.0335.86
4.3.70.0070.0205.81
4.3.60.0070.0205.78
4.3.50.0000.0275.87
4.3.40.0070.0435.77
4.3.30.0070.0275.00
4.3.20.0000.0335.00
4.3.10.0000.0235.00
4.3.00.0000.0237.05

preferences:
59.74 ms | 401 KiB | 5 Q