3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace GeneratorExample; class Pipeline { protected $generators = []; function __construct() { } function add(callable $generator) { $this->generators[] = $generator; return $this; } function resolve() { $inputs = func_get_args(); foreach ($this->generators as $g) { $generator = call_user_func_array($g, $inputs); $inputs = [$generator]; } return $generator; } } function uppercase(\Traversable $in) { foreach ($in as $word) { yield strtoupper($word); } } function reverse(\Traversable $in) { foreach ($in as $word) { yield strrev($word); } } function each_println(\Traversable $in) { foreach ($in as $line) { echo "$line\n"; } } $words = new \ArrayIterator(["foo", "bar", "baz"]); $p = new Pipeline; $p->add("GeneratorExample\\uppercase")->add("GeneratorExample\\reverse")->add("GeneratorExample\\each_println"); $p->resolve($words);

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.01018.43
8.3.50.0150.00621.99
8.3.40.0070.00718.59
8.3.30.0070.00718.84
8.3.20.0000.00818.72
8.3.10.0040.00421.13
8.3.00.0040.00423.61
8.2.180.0070.00716.50
8.2.170.0040.01122.96
8.2.160.0040.01218.94
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0000.00819.67
8.2.110.0060.00322.25
8.2.100.0060.00617.75
8.2.90.0100.00019.18
8.2.80.0040.00417.97
8.2.70.0040.00417.38
8.2.60.0060.00318.04
8.2.50.0030.00618.07
8.2.40.0050.00317.91
8.2.30.0000.00721.13
8.2.20.0000.00717.73
8.2.10.0080.00017.81
8.2.00.0080.00017.74
8.1.280.0040.01125.92
8.1.270.0070.00023.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00022.59
8.1.230.0040.00817.42
8.1.220.0000.00817.88
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0050.00317.47
8.1.180.0060.00318.10
8.1.170.0000.00818.59
8.1.160.0040.00418.90
8.1.150.0040.00418.66
8.1.140.0050.00317.38
8.1.130.0030.00317.88
8.1.120.0040.00417.47
8.1.110.0000.00817.50
8.1.100.0070.00017.34
8.1.90.0030.00517.46
8.1.80.0000.00817.55
8.1.70.0000.00717.30
8.1.60.0040.00417.63
8.1.50.0080.00017.40
8.1.40.0000.00817.36
8.1.30.0000.00717.67
8.1.20.0060.00317.60
8.1.10.0030.00617.47
8.1.00.0000.00817.58
8.0.300.0050.00318.77
8.0.290.0040.00416.88
8.0.280.0030.00518.39
8.0.270.0000.00717.33
8.0.260.0070.00016.86
8.0.250.0040.00416.95
8.0.240.0040.00417.00
8.0.230.0030.00316.96
8.0.220.0000.00816.91
8.0.210.0030.00316.95
8.0.200.0030.00317.04
8.0.190.0040.00417.02
8.0.180.0050.00216.99
8.0.170.0000.00717.01
8.0.160.0000.00717.07
8.0.150.0000.00716.91
8.0.140.0040.00416.98
8.0.130.0030.00313.44
8.0.120.0000.00816.92
8.0.110.0030.00616.98
8.0.100.0040.00416.86
8.0.90.0000.00716.83
8.0.80.0070.00716.86
8.0.70.0000.00817.06
8.0.60.0000.00716.84
8.0.50.0000.00716.99
8.0.30.0100.01217.19
8.0.20.0090.01417.40
8.0.10.0030.00617.04
8.0.00.0130.00716.68
7.4.330.0030.00314.78
7.4.320.0000.00716.63
7.4.300.0000.00716.63
7.4.290.0070.00016.64
7.4.280.0000.00716.53
7.4.270.0000.00716.51
7.4.260.0000.00513.30
7.4.250.0000.00816.57
7.4.240.0070.00016.63
7.4.230.0000.00716.64
7.4.220.0040.01116.63
7.4.210.0060.01016.55
7.4.200.0000.00716.61
7.4.190.0070.00016.56
7.4.160.0120.00916.39
7.4.150.0120.00617.40
7.4.140.0120.00917.86
7.4.130.0080.00816.47
7.4.120.0100.00716.48
7.4.110.0100.01316.55
7.4.100.0110.00816.33
7.4.90.0070.01016.68
7.4.80.0030.01519.37
7.4.70.0100.00716.57
7.4.60.0070.01016.66
7.4.50.0050.00516.29
7.4.40.0030.01222.52
7.4.30.0150.00916.49
7.4.00.0100.00815.08
7.3.330.0000.00513.30
7.3.320.0080.00413.26
7.3.310.0000.00716.18
7.3.300.0040.00416.37
7.3.290.0100.01016.33
7.3.280.0110.00516.31
7.3.270.0090.00917.40
7.3.260.0110.01318.24
7.3.250.0170.00316.50
7.3.240.0120.00616.27
7.3.230.0060.01016.39
7.3.210.0100.00616.18
7.3.200.0090.00919.39
7.3.190.0130.01016.67
7.3.180.0000.01716.66
7.3.170.0100.00716.34
7.3.160.0100.00716.29
7.3.120.0090.00814.68
7.3.110.0060.01014.63
7.3.100.0070.01014.70
7.3.90.0040.01114.97
7.3.80.0030.00614.94
7.3.70.0000.00915.00
7.3.60.0030.01014.90
7.3.50.0030.01014.93
7.3.40.0110.00414.79
7.3.30.0090.00014.79
7.3.20.0030.01016.54
7.3.10.0120.00516.33
7.3.00.0060.00816.40
7.2.330.0110.00716.71
7.2.320.0140.00416.81
7.2.310.0120.00616.57
7.2.300.0060.01216.78
7.2.290.0070.01316.82
7.2.250.0120.00315.23
7.2.240.0070.01414.96
7.2.230.0030.01015.08
7.2.220.0030.01015.01
7.2.210.0000.01415.28
7.2.200.0030.01015.12
7.2.190.0030.00615.14
7.2.180.0070.00714.94
7.2.170.0000.01814.90
7.2.130.0100.01016.55
7.2.120.0070.01416.76
7.2.110.0040.01516.59
7.2.100.0110.01116.65
7.2.90.0070.01416.50
7.2.80.0150.00416.63
7.2.70.0150.00816.55
7.2.60.0030.00616.73
7.2.50.0080.00516.60
7.2.40.0080.00616.39
7.2.30.0130.01016.40
7.2.20.0100.01016.77
7.2.10.0100.01316.82
7.2.00.0060.00818.27
7.1.330.0030.01315.92
7.1.320.0070.00715.82
7.1.310.0090.00615.95
7.1.300.0110.00415.96
7.1.290.0100.00315.86
7.1.280.0060.00315.53
7.1.270.0090.00015.82
7.1.260.0000.01415.80
7.1.250.0140.01115.86
7.1.100.0000.01518.26
7.1.70.0040.00816.92
7.1.60.0030.01919.40
7.1.50.0100.01317.07
7.1.00.0000.07722.29
7.0.200.0100.00016.74
7.0.140.0030.07322.10
7.0.70.0000.04321.93
7.0.60.0000.03321.86
7.0.50.0070.04022.18
7.0.40.0030.04020.05
7.0.30.0030.04020.12
7.0.20.0030.04020.08
7.0.10.0000.04020.12
7.0.00.0030.05020.01
5.6.280.0030.07321.14
5.6.220.0000.05720.71
5.6.210.0000.09020.62
5.6.200.0000.09321.11
5.6.190.0000.04320.93
5.6.180.0030.04721.06
5.6.170.0030.04321.10
5.6.160.0000.04021.05
5.6.150.0000.03321.19
5.6.140.0070.03721.05
5.6.130.0000.03721.04
5.6.120.0000.04321.02
5.6.110.0070.06021.11
5.6.100.0030.04021.09
5.6.90.0000.04321.17
5.6.80.0000.04320.48
5.6.70.0030.04320.38
5.6.60.0070.04720.48
5.6.50.0030.06020.41
5.6.40.0100.07320.54
5.6.30.0100.07720.38
5.6.20.0070.07720.45
5.6.10.0000.06020.31
5.6.00.0030.08020.42
5.5.360.0070.05720.45
5.5.350.0000.04720.43
5.5.340.0000.08720.89
5.5.330.0100.03320.81
5.5.320.0030.06320.64
5.5.310.0000.03720.88
5.5.300.0070.04320.88
5.5.290.0000.04320.89
5.5.280.0070.03720.95
5.5.270.0100.05020.87
5.5.260.0030.05020.76
5.5.250.0070.03720.73
5.5.240.0000.03320.27
5.5.230.0030.03320.11
5.5.220.0000.04320.19
5.5.210.0000.04020.20
5.5.200.0030.04320.24
5.5.190.0100.08020.16
5.5.180.0030.07020.20
5.5.160.0030.07719.97
5.5.150.0100.07020.23
5.5.140.0100.07720.26
5.5.130.0070.08020.20
5.5.120.0070.05020.26
5.5.110.0000.08320.19
5.5.100.0030.05320.09
5.5.90.0030.08020.07
5.5.80.0000.04719.93
5.5.70.0070.07020.14
5.5.60.0070.06720.16
5.5.50.0030.07720.07
5.5.40.0070.06019.96
5.5.30.0100.06320.14
5.5.20.0000.07019.95
5.5.10.0030.08319.98
5.5.00.0000.08320.02
5.4.450.0000.04319.45
5.4.440.0070.06019.53
5.4.430.0030.05019.35
5.4.420.0000.04019.44
5.4.410.0030.03719.07
5.4.400.0030.04718.85
5.4.390.0000.06319.18
5.4.380.0030.03319.23
5.4.370.0030.03019.13
5.4.360.0030.05319.12
5.4.350.0030.05718.91
5.4.340.0070.06019.05
5.4.320.0100.07019.18
5.4.310.0100.05718.88
5.4.300.0030.05719.07
5.4.290.0000.06019.04
5.4.280.0030.06718.85
5.4.270.0030.05318.84
5.4.260.0030.06019.15
5.4.250.0000.06719.14
5.4.240.0030.05319.12
5.4.230.0070.04018.94
5.4.220.0070.07319.12
5.4.210.0000.05319.17
5.4.200.0030.07018.87
5.4.190.0070.07019.12
5.4.180.0030.07319.08
5.4.170.0030.03718.93
5.4.160.0030.07318.85
5.4.150.0000.07019.07
5.4.140.0030.07016.48
5.4.130.0030.07016.47
5.4.120.0030.05316.47
5.4.110.0000.07016.57
5.4.100.0030.05316.49
5.4.90.0000.06316.55
5.4.80.0030.06716.38
5.4.70.0000.06316.47
5.4.60.0000.07716.34
5.4.50.0030.07716.31
5.4.40.0030.06316.33
5.4.30.0100.05316.47
5.4.20.0070.06316.31
5.4.10.0030.07716.40
5.4.00.0000.06015.94
5.3.290.0070.07014.72
5.3.280.0030.07714.54
5.3.270.0030.04714.54
5.3.260.0070.07314.72
5.3.250.0070.07714.74
5.3.240.0000.07314.66
5.3.230.0070.04014.52
5.3.220.0000.04314.69
5.3.210.0000.04014.63
5.3.200.0070.03314.70
5.3.190.0000.07714.59
5.3.180.0030.05314.58
5.3.170.0070.07014.61
5.3.160.0030.05314.66
5.3.150.0130.06314.63
5.3.140.0000.06014.56
5.3.130.0030.05314.61
5.3.120.0000.07714.48
5.3.110.0030.07714.48
5.3.100.0030.07714.05
5.3.90.0030.06714.02
5.3.80.0030.07714.05
5.3.70.0000.07014.04
5.3.60.0100.06714.12
5.3.50.0000.08013.97
5.3.40.0070.06714.04
5.3.30.0030.07314.01
5.3.20.0030.07013.67
5.3.10.0030.03713.77
5.3.00.0070.07313.75
5.2.170.0000.04312.21
5.2.160.0000.06312.21
5.2.150.0000.06712.21
5.2.140.0030.06312.21
5.2.130.0030.06312.21
5.2.120.0000.03012.21
5.2.110.0030.06312.21
5.2.100.0070.06012.21
5.2.90.0000.06312.21
5.2.80.0000.06012.21
5.2.70.0030.06012.21
5.2.60.0030.05312.21
5.2.50.0030.06012.21
5.2.40.0030.06312.21
5.2.30.0070.04712.21
5.2.20.0030.04312.21
5.2.10.0000.06712.21
5.2.00.0070.05712.21
5.1.60.0030.04312.21
5.1.50.0000.04712.21
5.1.40.0000.05712.21
5.1.30.0030.05312.21
5.1.20.0000.05712.21
5.1.10.0030.05312.21
5.1.00.0000.04312.21
5.0.50.0000.03712.21
5.0.40.0000.03712.21
5.0.30.0030.04712.21
5.0.20.0000.04312.21
5.0.10.0030.04312.21
5.0.00.0030.06312.21
4.4.90.0030.03312.21
4.4.80.0070.02712.21
4.4.70.0030.02012.21
4.4.60.0000.03712.21
4.4.50.0030.02712.21
4.4.40.0000.05312.21
4.4.30.0070.03312.21
4.4.20.0030.03712.21
4.4.10.0030.03012.21
4.4.00.0030.05712.21
4.3.110.0000.03712.21
4.3.100.0070.01712.21
4.3.90.0030.03312.21
4.3.80.0030.05312.21
4.3.70.0000.03712.21
4.3.60.0000.02312.21
4.3.50.0070.02312.21
4.3.40.0000.06012.21
4.3.30.0000.03712.21
4.3.20.0000.03712.21
4.3.10.0070.03012.21
4.3.00.0030.03312.21

preferences:
63.07 ms | 401 KiB | 5 Q