3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public $generator; public function __construct() { $generator = function() { yield from [1,1,2,3,5,8,13,21]; }; $this->generator = $generator(); } public function getValue() { while($this->generator->valid()) { $latitude = $this->generator->current(); $this->generator->next(); return $latitude; } throw new RangeException('End of line'); } } $line = new test(); try { for($i = 0; $i < 10; ++$i) { echo $line->getValue(); echo PHP_EOL; } } catch (Exception $e) { echo $e->getMessage(); }

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.0140.00718.52
8.3.50.0110.00416.67
8.3.40.0150.00018.96
8.3.30.0120.00318.65
8.3.20.0110.00420.34
8.3.10.0080.00021.97
8.3.00.0080.00020.96
8.2.180.0100.01018.32
8.2.170.0100.00322.96
8.2.160.0110.00422.00
8.2.150.0030.00624.18
8.2.140.0110.00724.66
8.2.130.0040.00422.30
8.2.120.0070.00026.35
8.2.110.0070.00321.07
8.2.100.0040.00818.09
8.2.90.0040.00419.23
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0000.00818.04
8.2.50.0030.00618.10
8.2.40.0040.00420.63
8.2.30.0000.00719.27
8.2.20.0080.00018.01
8.2.10.0000.00818.15
8.2.00.0030.00518.07
8.1.280.0070.01125.92
8.1.270.0040.00422.04
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00023.82
8.1.230.0080.00417.42
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0110.00017.10
8.1.180.0000.00718.10
8.1.170.0040.00418.59
8.1.160.0000.00718.96
8.1.150.0070.00020.23
8.1.140.0000.00719.66
8.1.130.0040.00418.83
8.1.120.0030.00317.38
8.1.110.0070.00017.50
8.1.100.0030.00617.45
8.1.90.0110.00017.40
8.1.80.0040.00417.48
8.1.70.0020.00517.45
8.1.60.0060.00317.64
8.1.50.0040.00417.45
8.1.40.0040.00417.43
8.1.30.0030.00617.62
8.1.20.0030.00517.61
8.1.10.0030.00517.55
8.1.00.0060.00317.45
8.0.300.0070.00018.77
8.0.290.0040.00416.88
8.0.280.0050.00318.37
8.0.270.0000.00717.23
8.0.260.0000.00616.84
8.0.250.0030.00316.97
8.0.240.0000.00717.06
8.0.230.0030.00317.04
8.0.220.0000.00717.06
8.0.210.0030.00516.95
8.0.200.0080.00017.03
8.0.190.0040.00417.04
8.0.180.0030.00516.97
8.0.170.0000.00716.89
8.0.160.0040.00416.93
8.0.150.0040.00417.00
8.0.140.0040.00416.91
8.0.130.0030.00313.36
8.0.120.0050.00216.95
8.0.110.0000.00716.83
8.0.100.0050.00516.84
8.0.90.0030.00317.00
8.0.80.0130.01016.91
8.0.70.0000.00717.00
8.0.60.0000.00816.98
8.0.50.0050.00316.91
8.0.30.0080.01217.13
8.0.20.0100.01117.40
8.0.10.0000.00717.08
8.0.00.0180.00016.93
7.4.330.0000.00715.55
7.4.320.0070.00016.42
7.4.300.0030.00316.48
7.4.290.0050.00316.37
7.4.280.0000.00816.52
7.4.270.0030.00316.44
7.4.260.0000.00613.17
7.4.250.0070.00016.46
7.4.240.0060.00316.47
7.4.230.0000.00716.43
7.4.220.0120.00616.55
7.4.210.0060.00816.62
7.4.200.0000.00816.49
7.4.160.0100.00616.47
7.4.150.0140.00417.40
7.4.140.0080.01417.86
7.4.130.0150.00916.44
7.4.120.0070.01116.46
7.4.110.0030.01416.74
7.4.100.0130.00316.70
7.4.90.0040.01316.57
7.4.80.0140.01119.39
7.4.70.0090.00916.53
7.4.60.0060.00916.40
7.4.50.0050.00516.43
7.4.40.0100.00716.58
7.4.30.0130.00316.67
7.4.00.0090.00615.30
7.3.330.0000.00513.32
7.3.320.0050.00013.33
7.3.310.0000.00816.42
7.3.300.0030.00316.36
7.3.290.0100.00916.35
7.3.280.0090.00816.34
7.3.270.0090.00917.40
7.3.260.0100.01116.51
7.3.250.0080.01316.34
7.3.240.0160.00116.44
7.3.230.0160.01016.33
7.3.210.0100.00616.49
7.3.200.0030.01416.37
7.3.190.0130.00316.59
7.3.180.0060.00916.35
7.3.170.0100.00716.55
7.3.160.0070.01016.36
7.2.330.0110.00616.59
7.2.320.0080.01316.64
7.2.310.0090.01516.78
7.2.300.0120.01116.61
7.2.290.0080.01216.74
7.2.60.0140.00916.82
7.2.50.0070.00717.09
7.2.00.0030.01519.53
7.1.200.0030.01015.64
7.1.70.0040.00417.13
7.1.60.0110.00017.41
7.1.50.0090.00316.73
7.1.40.0040.00716.55
7.1.30.0070.00416.50
7.1.20.0030.00916.69
7.1.10.0030.00916.68
7.1.00.0030.00816.71
7.0.200.0000.00816.53
7.0.190.0000.00916.80
7.0.180.0020.00716.18
7.0.170.0000.00916.39
7.0.160.0030.00916.45
7.0.150.0000.01416.41
7.0.140.0000.01216.32
7.0.130.0000.02116.60
7.0.120.0070.00716.40
7.0.110.0060.00316.55
7.0.100.0050.00516.22
7.0.90.0060.00616.38
7.0.80.0050.00516.43
7.0.70.0050.00516.46
7.0.60.0030.00916.32
7.0.50.0030.01416.41
7.0.40.0040.00815.41
7.0.30.0030.01315.41
7.0.20.0000.01015.41
7.0.10.0080.00015.41
7.0.00.0000.00815.41

preferences:
32.78 ms | 400 KiB | 5 Q