3v4l.org

run code in 300+ PHP versions simultaneously
<?php function debugPrintFilter() { return function(\Traversable $input) { foreach ($input as $in) { var_dump($in); yield $in; } }; } function fooFilter() { return function(\Traversable $input) { foreach ($input as $in) { yield "foo"; } }; } function upperCaseStringFilter() { return function(\Traversable $input) { foreach ($input as $in) { yield strtoupper($in); } }; } class FilterPipeline implements \IteratorAggregate { protected $filters = []; protected $src; function __construct() { } function src(\Traversable $it) { $this->src = $it; return $this; } function pipe(callable $filter) { array_push($this->filters, $filter); return $this; } function getIterator() { $it = $this->src; foreach ($this->filters as $filter) { $it = $filter($it); } return $it; } } $p = (new FilterPipeline) ->src(new \ArrayIterator(["foo", "bar", "baz"])) ->pipe(upperCaseStringFilter()) ->pipe(debugPrintFilter()) ->pipe(fooFilter()); foreach ($p as $val) { var_dump("Output", $val); }

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.0070.00718.43
8.3.50.0240.00521.27
8.3.40.0110.00718.94
8.3.30.0130.00020.13
8.3.20.0080.00020.50
8.3.10.0100.00021.21
8.3.00.0000.01822.34
8.2.180.0160.00316.88
8.2.170.0110.00422.96
8.2.160.0060.01022.30
8.2.150.0030.00624.18
8.2.140.0050.00524.66
8.2.130.0080.00026.16
8.2.120.0050.00221.12
8.2.110.0030.00622.05
8.2.100.0090.00317.91
8.2.90.0040.00419.22
8.2.80.0060.00319.25
8.2.70.0000.00817.50
8.2.60.0050.00317.93
8.2.50.0030.00518.07
8.2.40.0000.00818.16
8.2.30.0040.00419.32
8.2.20.0040.00417.55
8.2.10.0080.00017.77
8.2.00.0080.00417.74
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.37
8.1.230.0070.00420.93
8.1.220.0080.00018.77
8.1.210.0040.00419.02
8.1.200.0040.00417.35
8.1.190.0070.00017.53
8.1.180.0050.00318.10
8.1.170.0000.00818.72
8.1.160.0000.00718.84
8.1.150.0040.00418.56
8.1.140.0040.00417.45
8.1.130.0030.00317.82
8.1.120.0000.00717.47
8.1.110.0050.00317.53
8.1.100.0030.00317.54
8.1.90.0040.00417.46
8.1.80.0040.00417.52
8.1.70.0000.00717.40
8.1.60.0000.00817.61
8.1.50.0060.00317.54
8.1.40.0000.01017.43
8.1.30.0040.00417.60
8.1.20.0040.00417.60
8.1.10.0040.00417.64
8.1.00.0040.00417.46
8.0.300.0070.00320.10
8.0.290.0030.00617.05
8.0.280.0050.00218.45
8.0.270.0030.00517.15
8.0.260.0080.00016.82
8.0.250.0070.00017.07
8.0.240.0030.00516.96
8.0.230.0040.00416.93
8.0.220.0030.00316.92
8.0.210.0000.00716.85
8.0.200.0000.00717.02
8.0.190.0040.00416.92
8.0.180.0050.00316.98
8.0.170.0040.00416.91
8.0.160.0040.00417.02
8.0.150.0040.00416.88
8.0.140.0000.00716.90
8.0.130.0050.00013.36
8.0.120.0000.00816.84
8.0.110.0030.00316.93
8.0.100.0000.00716.80
8.0.90.0000.00816.85
8.0.80.0100.01016.91
8.0.70.0020.00516.91
8.0.60.0000.00717.04
8.0.50.0050.00216.98
8.0.30.0080.01017.11
8.0.20.0090.01017.40
8.0.10.0040.00417.05
8.0.00.0080.01216.71
7.4.330.0030.00316.77
7.4.320.0030.00316.54
7.4.300.0040.00416.61
7.4.290.0030.00316.47
7.4.280.0040.00416.44
7.4.270.0040.00416.51
7.4.260.0070.00013.26
7.4.250.0090.00016.58
7.4.240.0000.00716.54
7.4.230.0040.00416.55
7.4.220.0110.00716.51
7.4.210.0060.00816.56
7.4.200.0030.00416.69
7.4.190.0000.00816.67
7.4.160.0130.00316.39
7.4.150.0090.00917.40
7.4.140.0090.00817.86
7.4.130.0090.00816.50
7.4.120.0130.00616.61
7.4.110.0100.01016.61
7.4.100.0090.00916.56
7.4.90.0120.00916.45
7.4.80.0120.00919.39
7.4.70.0070.01016.51
7.4.60.0140.00316.57
7.4.50.0050.00316.41
7.4.40.0120.00322.77
7.4.30.0080.00816.38
7.4.00.0060.01014.93
7.3.330.0000.00513.33
7.3.320.0080.00013.40
7.3.310.0040.00416.51
7.3.300.0000.00716.41
7.3.290.0030.01016.41
7.3.280.0080.00716.41
7.3.270.0170.00017.40
7.3.260.0110.01018.24
7.3.250.0130.00816.66
7.3.240.0100.00716.66
7.3.230.0070.01016.66
7.3.210.0060.01216.60
7.3.200.0040.01519.39
7.3.190.0180.00016.71
7.3.180.0070.01316.39
7.3.170.0160.00016.45
7.3.160.0040.01316.63
7.3.120.0080.00414.66
7.2.330.0090.00916.71
7.2.320.0100.00716.75
7.2.310.0090.00916.43
7.2.300.0090.01316.69
7.2.290.0080.00816.57
7.2.60.0000.01317.07
7.2.00.0000.01219.43
7.1.200.0060.00915.71
7.1.100.0050.00518.07
7.1.70.0000.00817.09
7.1.60.0100.00319.17
7.1.50.0140.01016.76
7.1.00.0000.04022.36
7.0.200.0030.00616.80
7.0.140.0070.07022.04
7.0.60.0100.07720.02
7.0.50.0100.06017.74
7.0.40.0170.04020.02
7.0.30.0400.05020.30
7.0.20.0270.05720.38
7.0.10.0070.04020.33
7.0.00.0030.08720.20
5.6.280.0030.07321.14
5.6.210.0000.06320.68
5.6.200.0170.02718.27
5.6.190.0100.03720.63
5.6.180.0400.04020.41
5.6.170.0300.07320.52
5.6.160.0030.08720.39
5.6.150.0030.06018.15
5.6.140.0030.09318.14
5.6.130.0000.08718.21
5.6.120.0000.04321.03
5.6.110.0070.04321.03
5.6.100.0030.04021.13
5.6.90.0070.08320.90
5.6.80.0100.07720.30
5.5.350.3100.03320.36
5.5.340.0100.03717.96
5.5.330.0030.04720.19
5.5.320.0030.08320.36
5.5.310.0300.05720.30
5.5.300.0000.04317.98
5.5.290.0130.05318.02
5.5.280.0100.05720.89
5.5.270.0030.06320.69
5.5.260.0130.07720.66
5.5.250.0130.06320.70
5.5.240.0200.06720.21
5.4.450.0530.05719.20
5.4.440.0470.07019.42
5.4.430.0430.03719.52
5.4.420.0470.04019.26
5.4.410.0470.04719.36
5.4.400.0400.03319.00
5.4.390.0500.03718.95
5.4.380.0400.03319.20
5.4.370.0530.06018.98
5.4.360.0570.04719.20
5.4.350.0370.04019.31
5.4.340.0370.03719.20
5.4.320.0330.04319.23
5.4.310.0270.04019.02
5.4.300.0470.03719.21
5.4.290.0270.04018.85
5.4.280.0300.03718.86
5.4.270.0300.04019.19
5.4.260.0300.03719.21
5.4.250.0570.03719.21
5.4.240.0400.03719.13
5.4.230.0430.07019.13
5.4.220.0300.04319.15
5.4.210.0370.03318.84
5.4.200.0400.03318.98
5.4.190.0370.03719.15
5.4.180.0370.03318.94
5.4.170.0370.04018.97
5.4.160.0270.04719.22
5.4.150.0400.03319.13
5.4.140.0370.03716.38
5.4.130.0370.02716.50
5.4.120.0300.03316.38
5.4.110.0270.03716.45
5.4.100.0330.03716.61
5.4.90.0300.04016.50
5.4.80.0470.05016.59
5.4.70.0500.06316.59
5.4.60.0530.03716.15
5.4.50.0470.06316.24
5.4.40.0470.06316.55
5.4.30.0470.04316.53
5.4.20.0430.03716.34
5.4.10.0430.05716.24
5.4.00.0600.05015.82
5.3.290.0400.03014.66
5.3.280.0370.03714.71
5.3.270.0370.04714.63
5.3.260.0370.04014.63
5.3.250.0300.03714.73
5.3.240.0330.03314.59
5.3.230.0370.03014.68
5.3.220.0330.03314.55
5.3.210.0330.04014.55
5.3.200.0300.04014.48
5.3.190.0330.04314.50
5.3.180.0470.04314.54
5.3.170.0330.04314.57
5.3.160.0530.06014.50
5.3.150.0430.03314.56
5.3.140.0470.03314.79
5.3.130.0400.04314.55
5.3.120.0470.06314.64
5.3.110.0370.04714.64
5.3.100.0530.04014.09
5.3.90.0700.05014.19
5.3.80.0470.05013.92
5.3.70.0470.06714.10
5.3.60.0430.07013.98
5.3.50.0470.04013.85
5.3.40.0500.05713.97
5.3.30.0470.06713.82
5.3.20.0430.03713.78
5.3.10.0500.06313.68
5.3.00.0400.04013.54
5.2.170.0300.04311.05
5.2.160.0500.04711.39
5.2.150.0400.05711.22
5.2.140.0500.05011.15
5.2.130.0300.03711.03
5.2.120.0370.03311.02
5.2.110.0370.05011.02
5.2.100.0430.04311.03
5.2.90.0370.03711.03
5.2.80.0330.03011.09
5.2.70.0300.03011.19
5.2.60.0330.03011.26
5.2.50.0400.03710.91
5.2.40.0300.05710.96
5.2.30.0370.03711.02
5.2.20.0330.05711.03
5.2.10.0300.03710.98
5.2.00.0330.03310.72
5.1.60.0300.0279.92
5.1.50.0370.04710.21
5.1.40.0370.03710.06
5.1.30.0330.04310.45
5.1.20.0330.04310.32
5.1.10.0300.03310.00
5.1.00.0300.0379.96
5.0.50.0130.0308.62
5.0.40.0200.0208.56
5.0.30.0270.0308.15
5.0.20.0200.0308.31
5.0.10.0200.0278.22
5.0.00.0200.0538.28
4.4.90.0130.0177.39
4.4.80.0170.0337.39
4.4.70.0270.0107.39
4.4.60.0130.0337.39
4.4.50.0170.0207.39
4.4.40.0170.0407.39
4.4.30.0170.0177.39
4.4.20.0130.0177.39
4.4.10.0130.0207.39
4.4.00.0130.0377.39
4.3.110.0170.0237.39
4.3.100.0130.0377.39
4.3.90.0130.0277.39
4.3.80.0230.0477.39
4.3.70.0230.0107.39
4.3.60.0170.0307.39
4.3.50.0170.0337.39
4.3.40.0170.0507.39
4.3.30.0070.0237.39
4.3.20.0070.0337.39
4.3.10.0130.0377.39
4.3.00.0100.0337.39

preferences:
46.57 ms | 401 KiB | 5 Q