3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testing { protected $latitudes = [2,4,6,8,10]; protected $longitudes = [3,6,9,12,15]; public function __construct() { } private function nextLatitude() { yield from $this->latitudes; } public function getLatitude() { $this->nextLatgitude()->next(); return $this->nextLatitude()->current(); } private function nextLongitude() { yield from $this->longitudes; } public function getLongitude() { $this->nextLongitude()->next(); return $this->nextLongitude()->current(); } } $x = new testing(); echo $x->getLatitude(), PHP_EOL; echo $x->getLongitude(), PHP_EOL, PHP_EOL; echo $x->getLatitude(), PHP_EOL; echo $x->getLongitude(), PHP_EOL, PHP_EOL; echo $x->getLatitude(), PHP_EOL; echo $x->getLongitude(), PHP_EOL, PHP_EOL;

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.0110.01118.43
8.3.50.0140.00016.40
8.3.40.0110.00418.82
8.3.30.0110.00418.84
8.3.20.0070.00021.97
8.3.10.0020.00521.73
8.3.00.0000.00820.80
8.2.180.0110.00318.52
8.2.170.0140.00722.96
8.2.160.0130.00322.08
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.77
8.2.110.0040.00420.84
8.2.100.0110.00017.84
8.2.90.0000.00917.63
8.2.80.0040.00419.53
8.2.70.0080.00017.79
8.2.60.0000.00818.09
8.2.50.0040.00418.10
8.2.40.0000.00920.61
8.2.30.0040.00419.23
8.2.20.0000.00717.97
8.2.10.0000.00717.96
8.2.00.0040.00417.98
8.1.280.0120.00925.92
8.1.270.0070.00323.91
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0060.00620.29
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0030.00617.36
8.1.190.0000.00817.23
8.1.180.0080.00418.10
8.1.170.0050.00318.54
8.1.160.0000.00718.72
8.1.150.0100.00020.16
8.1.140.0030.00619.53
8.1.130.0030.00318.84
8.1.120.0090.00017.31
8.1.110.0040.00417.45
8.1.100.0000.00817.39
8.1.90.0030.00517.39
8.1.80.0030.00317.40
8.1.70.0000.00717.29
8.1.60.0060.00317.48
8.1.50.0040.00417.55
8.1.40.0070.00017.46
8.1.30.0060.00317.63
8.1.20.0040.00417.60
8.1.10.0000.00817.55
8.1.00.0030.00617.49
8.0.300.0000.00719.66
8.0.290.0050.00316.58
8.0.280.0040.00418.34
8.0.270.0070.00017.27
8.0.260.0000.00716.92
8.0.250.0030.00316.88
8.0.240.0000.01116.99
8.0.230.0000.00716.97
8.0.220.0000.00716.84
8.0.210.0000.00716.82
8.0.200.0060.00016.95
8.0.190.0040.00416.90
8.0.180.0000.00816.91
8.0.170.0050.00516.88
8.0.160.0000.00716.84
8.0.150.0000.00716.86
8.0.140.0000.00716.78
8.0.130.0000.00613.27
8.0.120.0000.00716.78
8.0.110.0070.00016.87
8.0.100.0000.00716.75
8.0.90.0050.00216.73
8.0.80.0120.00616.88
8.0.70.0070.00016.77
8.0.60.0000.00716.90
8.0.50.0040.00416.73
8.0.30.0120.00817.02
8.0.20.0090.01017.40
8.0.10.0040.00417.04
8.0.00.0090.00916.75
7.4.330.0060.00015.55
7.4.320.0060.00016.46
7.4.300.0030.00316.61
7.4.290.0000.00816.54
7.4.280.0080.00016.65
7.4.270.0030.00316.52
7.4.260.0060.00013.29
7.4.250.0000.00816.53
7.4.240.0070.00016.62
7.4.230.0040.00416.66
7.4.220.0030.01516.48
7.4.210.0110.00716.70
7.4.200.0070.00016.68
7.4.160.0050.01116.43
7.4.150.0030.01617.40
7.4.140.0090.00917.86
7.4.130.0190.00016.37
7.4.120.0110.00716.60
7.4.110.0070.01116.52
7.4.100.0070.01016.46
7.4.90.0100.00716.48
7.4.80.0190.00319.39
7.4.70.0070.01016.45
7.4.60.0030.01316.59
7.4.50.0100.00616.55
7.4.40.0090.00616.45
7.4.30.0080.00816.60
7.4.10.0060.00914.96
7.4.00.0080.00914.92
7.3.330.0000.00613.37
7.3.320.0000.00513.19
7.3.310.0030.00616.30
7.3.300.0030.00316.38
7.3.290.0050.00916.39
7.3.280.0090.00816.36
7.3.270.0100.00717.40
7.3.260.0080.01116.50
7.3.250.0090.01016.42
7.3.240.0110.01216.46
7.3.230.0170.00016.62
7.3.210.0030.01416.22
7.3.200.0030.01316.48
7.3.190.0110.00416.37
7.3.180.0030.01316.48
7.3.170.0030.01316.28
7.3.160.0110.00616.29
7.3.130.0100.00714.74
7.3.120.0050.01314.75
7.3.110.0100.00814.89
7.3.100.0070.00614.84
7.3.90.0050.00914.62
7.3.80.0050.01214.96
7.3.70.0080.00614.91
7.3.60.0050.01114.66
7.3.50.0060.00614.78
7.3.40.0070.00914.78
7.3.30.0060.00914.80
7.3.20.0080.00416.56
7.3.10.0030.00816.58
7.3.00.0040.01016.62
7.2.330.0070.01116.29
7.2.320.0060.01016.63
7.2.310.0100.01316.36
7.2.300.0070.01016.53
7.2.290.0040.01216.24
7.2.260.0070.01014.97
7.2.250.0090.00914.99
7.2.240.0070.01015.11
7.2.230.0080.00514.95
7.2.220.0070.00914.97
7.2.210.0030.01114.85
7.2.200.0100.00614.85
7.2.190.0050.00714.76
7.2.180.0070.00615.00
7.2.170.0050.01114.98
7.2.160.0060.00615.14
7.2.150.0150.00016.65
7.2.140.0070.00716.81
7.2.130.0090.00716.71
7.2.120.0060.00816.83
7.2.110.0090.00316.77
7.2.100.0040.00716.51
7.2.90.0090.00516.77
7.2.80.0040.00816.79
7.2.70.0040.00716.69
7.2.60.0130.00516.74
7.2.50.0100.00416.77
7.2.40.0080.00516.76
7.2.30.0040.00916.82
7.2.20.0070.00816.64
7.2.10.0070.00816.79
7.2.00.0070.00317.64
7.1.330.0040.01115.57
7.1.320.0090.00715.64
7.1.310.0030.00815.64
7.1.300.0040.00915.61
7.1.290.0050.00815.57
7.1.280.0040.00515.58
7.1.270.0080.00715.63
7.1.260.0050.00415.50
7.1.250.0050.00815.65
7.1.240.0060.00615.54
7.1.230.0080.00515.69
7.1.220.0110.00315.53
7.1.210.0050.00815.69
7.1.200.0060.00415.61
7.1.190.0050.00615.53
7.1.180.0080.00515.57
7.1.170.0090.00515.54
7.1.160.0100.00615.59
7.1.150.0060.00615.57
7.1.140.0090.00615.64
7.1.130.0080.00515.63
7.1.120.0060.00615.31
7.1.110.0090.00215.49
7.1.100.0100.00515.60
7.1.90.0030.00915.61
7.1.80.0060.00615.56
7.1.70.0060.00515.97
7.1.60.0110.01121.38
7.1.50.0130.01021.26
7.1.40.0140.00821.12
7.1.30.0160.00921.11
7.1.20.0160.00721.21
7.1.10.0100.00915.28
7.1.00.0110.00715.27
7.0.330.0050.00515.22
7.0.320.0030.01015.03
7.0.310.0110.00315.15
7.0.300.0060.00815.10
7.0.290.0060.00715.05
7.0.280.0050.00815.38
7.0.270.0060.00615.13
7.0.260.0050.00715.09
7.0.250.0070.00515.21
7.0.240.0070.00315.25
7.0.230.0070.00515.19
7.0.220.0070.00614.94
7.0.210.0060.00715.29
7.0.200.0100.00715.02
7.0.190.0120.00615.02
7.0.180.0110.00714.75
7.0.170.0140.00714.93
7.0.160.0110.00814.81
7.0.150.0130.00514.90
7.0.140.0110.00814.93
7.0.130.0120.00515.13
7.0.120.0110.00815.14
7.0.110.0110.00715.02
7.0.100.0470.00814.94
7.0.90.0110.00914.95
7.0.80.0130.01014.81
7.0.70.0100.00814.89
7.0.60.0130.00414.84
7.0.50.0130.01014.97
7.0.40.0100.00813.70
7.0.30.0070.01013.50
7.0.20.0100.01113.46
7.0.10.0120.00713.41
7.0.00.0100.00813.67
5.6.400.0040.00814.06
5.6.390.0090.00314.06
5.6.380.0020.01014.15
5.6.370.0110.00014.10
5.6.360.0140.00313.89
5.6.350.0000.01514.34
5.6.340.0090.00614.30
5.6.330.0070.00414.30
5.6.320.0090.00614.38
5.6.310.0060.01213.97
5.6.300.0060.00313.99
5.6.290.0070.00714.30
5.6.280.0040.01114.41
5.6.270.0030.01013.98
5.6.260.0070.00414.00
5.6.250.0130.00014.25
5.6.240.0040.00414.34
5.6.230.0030.00914.36
5.6.220.0030.01013.95
5.6.210.0070.00714.19
5.6.200.0070.00314.03
5.6.190.0000.01014.29
5.6.180.0080.00414.11
5.6.170.0070.00714.27
5.6.160.0080.00814.05
5.6.150.0000.01014.35
5.6.140.0030.01014.36
5.6.130.0030.00514.11
5.6.120.0000.01214.02
5.6.110.0070.00313.99
5.6.100.0070.00714.23
5.6.90.0050.00514.23
5.6.80.0000.00914.02
5.6.70.0060.00614.16
5.6.60.0030.01214.30
5.6.50.0000.01414.13
5.6.40.0030.01313.93
5.6.30.0030.01313.88
5.6.20.0070.00713.92
5.6.10.0040.00813.94
5.6.00.0000.00813.98

preferences:
63.53 ms | 401 KiB | 5 Q