3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 12.for_loops_fib.php $fib = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89]; $size = sizeof($fib); for($i = 0; $i < $size; $i++) { print $fib[$i].PHP_EOL; } // We can also create this same series using simple math. $a = 1; $b = 2; print $a.PHP_EOL; print $b.PHP_EOL; for($i = 0; $i < $size-2; $i++) { $newB = $a+$b; $a = $b; $b = $newB; print $newB.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.130.0040.00418.29
8.3.120.0040.00418.76
8.3.110.0000.00820.94
8.3.100.0050.00324.06
8.3.90.0040.00426.77
8.3.80.0000.01018.56
8.3.70.0090.00618.43
8.3.60.0090.00618.55
8.3.50.0240.00921.09
8.3.40.0090.00618.84
8.3.30.0040.01119.22
8.3.20.0050.00320.24
8.3.10.0080.00023.66
8.3.00.0040.00419.80
8.2.250.0110.00416.65
8.2.240.0000.00816.96
8.2.230.0060.00322.58
8.2.220.0100.00037.54
8.2.210.0080.00026.77
8.2.200.0090.00018.16
8.2.190.0030.01316.58
8.2.180.0120.00616.63
8.2.170.0030.01018.94
8.2.160.0080.00522.96
8.2.150.0060.00324.18
8.2.140.0000.00924.66
8.2.130.0040.00426.16
8.2.120.0040.00419.75
8.2.110.0000.01119.30
8.2.100.0070.00417.84
8.2.90.0060.00319.52
8.2.80.0040.00419.34
8.2.70.0000.00817.63
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0050.00618.22
8.2.30.0050.00318.12
8.2.20.0000.00817.62
8.2.10.0000.00718.02
8.2.00.0000.00817.99
8.1.300.0050.00317.91
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0040.00420.25
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00022.66
8.1.230.0040.00820.79
8.1.220.0050.00317.74
8.1.210.0030.00619.80
8.1.200.0030.00617.35
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0050.00218.55
8.1.160.0080.00022.01
8.1.150.0040.00418.91
8.1.140.0000.00717.41
8.1.130.0030.00317.87
8.1.120.0040.00417.30
8.1.110.0000.00717.46
8.1.100.0050.00317.45
8.1.90.0000.00717.49
8.1.80.0000.00717.46
8.1.70.0000.00617.40
8.1.60.0060.00317.58
8.1.50.0000.00817.43
8.1.40.0060.00317.55
8.1.30.0060.00317.48
8.1.20.0060.00317.56
8.1.10.0060.00317.57
8.1.00.0050.00317.43
8.0.300.0040.00420.02
8.0.290.0020.00516.63
8.0.280.0070.00018.35
8.0.270.0030.00316.82
8.0.260.0000.00717.31
8.0.250.0060.00017.03
8.0.240.0000.00616.94
8.0.230.0030.00316.95
8.0.220.0030.00316.77
8.0.210.0080.00016.76
8.0.200.0070.00016.82
8.0.190.0040.00416.96
8.0.180.0000.00716.96
8.0.170.0000.00916.96
8.0.160.0060.00316.82
8.0.150.0030.00316.72
8.0.140.0000.00816.73
8.0.130.0030.00313.38
8.0.120.0080.00016.83
8.0.110.0040.00416.73
8.0.100.0040.00416.75
8.0.90.0000.00716.79
8.0.80.0150.00016.86
8.0.70.0070.00016.71
8.0.60.0030.00516.89
8.0.50.0040.00416.84
8.0.30.0130.00617.20
8.0.20.0100.00817.40
8.0.10.0040.00416.88
8.0.00.0120.00916.71
7.4.330.0020.00215.14
7.4.320.0000.00716.49
7.4.300.0030.00316.58
7.4.290.0070.00016.51
7.4.280.0000.00716.44
7.4.270.0040.00416.64
7.4.260.0070.00016.47
7.4.250.0070.00016.47
7.4.240.0020.00516.52
7.4.230.0030.00316.50
7.4.220.0030.01316.57
7.4.210.0120.00816.44
7.4.200.0040.00416.39
7.4.160.0110.00816.61
7.4.150.0110.00717.40
7.4.140.0100.01017.86
7.4.130.0120.00716.50
7.4.120.0050.01216.44
7.4.110.0070.01016.43
7.4.100.0110.01116.54
7.4.90.0110.00816.52
7.4.80.0030.01419.39
7.4.70.0060.01616.62
7.4.60.0070.01716.41
7.4.50.0030.00616.49
7.4.40.0090.01216.42
7.4.30.0100.01016.70
7.4.00.0070.00014.80
7.3.330.0050.00013.21
7.3.320.0000.00713.13
7.3.310.0030.00516.41
7.3.300.0000.00716.27
7.3.290.0080.00816.37
7.3.280.0060.01316.39
7.3.270.0140.00317.40
7.3.260.0130.00616.49
7.3.250.0120.00716.40
7.3.240.0070.01016.35
7.3.230.0110.00816.39
7.3.210.0080.00816.52
7.3.200.0070.01219.39
7.3.190.0060.00916.31
7.3.180.0070.01016.58
7.3.170.0100.00616.52
7.3.160.0100.00616.44
7.3.120.0030.01014.91
7.3.110.0070.00714.82
7.3.100.0060.01014.83
7.3.90.0040.00714.92
7.3.80.0000.01114.58
7.3.70.0040.01214.84
7.3.60.0030.01414.78
7.3.50.0070.00714.82
7.3.40.0080.00414.57
7.3.30.0030.01014.98
7.3.20.0060.00316.59
7.3.10.0030.00616.78
7.3.00.0060.00916.79
7.2.330.0070.01016.63
7.2.320.0060.01316.77
7.2.310.0100.00616.79
7.2.300.0100.00716.85
7.2.290.0110.00816.68
7.2.240.0040.00414.90
7.2.230.0100.00615.18
7.2.220.0030.01015.02
7.2.210.0070.01115.23
7.2.200.0040.00814.85
7.2.190.0060.00915.28
7.2.180.0040.01414.88
7.2.170.0040.01114.85
7.2.160.0070.01014.81
7.2.150.0040.01116.77
7.2.140.0030.01316.69
7.2.130.0030.00616.93
7.2.120.0090.00316.73
7.2.110.0030.00817.03
7.2.100.0100.00616.69
7.2.90.0030.01317.19
7.2.80.0060.00317.14
7.2.70.0000.01317.09
7.2.60.0070.00716.86
7.2.50.0080.00316.76
7.2.40.0080.00817.04
7.2.30.0040.01117.00
7.2.20.0000.01216.74
7.2.10.0120.00316.80
7.2.00.0050.00918.14
7.1.330.0100.00315.80
7.1.320.0090.00615.73
7.1.310.0090.00615.87
7.1.300.0070.00715.75
7.1.290.0060.00615.64
7.1.280.0070.00715.85
7.1.270.0060.00615.85
7.1.260.0110.00415.77
7.1.250.0060.00616.06
7.1.200.0070.01015.55
7.1.100.0000.01118.07
7.1.70.0030.01017.27
7.1.60.0090.01619.86
7.1.50.0070.01716.70
7.1.00.0070.07322.46
7.0.200.0070.00016.94
7.0.60.0200.07321.67
7.0.50.0130.06317.84
7.0.40.0100.07320.38
7.0.30.0230.03720.17
7.0.20.0170.04320.21
7.0.10.0430.06720.09
7.0.00.0100.07320.00
5.6.280.0100.06720.92
5.6.210.0070.05320.69
5.6.200.0130.04718.23
5.6.190.0130.07320.57
5.6.180.0070.03720.42
5.6.170.0200.04720.71
5.6.160.0100.08020.34
5.6.150.0000.04318.18
5.6.140.0030.04718.14
5.6.130.0100.06718.12
5.6.120.0200.05021.05
5.6.110.0100.05321.00
5.6.100.0170.06021.14
5.6.90.0070.08020.95
5.6.80.0030.08720.48
5.5.350.0170.03320.33
5.5.340.0030.04017.88
5.5.330.0070.04020.20
5.5.320.0200.06320.28
5.5.310.0230.07720.41
5.5.300.0030.05318.02
5.5.290.0130.07718.04
5.5.280.0100.08720.87
5.5.270.0100.09320.75
5.5.260.0070.08720.86
5.5.250.0170.07020.68
5.5.240.0170.04720.15
5.4.450.0100.06019.61
5.4.440.0430.07019.54
5.4.430.0100.05319.62
5.4.420.0070.05719.68
5.4.410.0100.05319.34
5.4.400.0100.05019.33
5.4.390.0170.04719.13
5.4.380.0100.05319.13
5.4.370.0130.06719.04
5.4.360.0130.07319.16
5.4.350.0300.07019.07
5.4.340.0100.05318.98
5.4.320.0200.04718.97
5.4.310.0100.05318.95
5.4.300.0070.05319.16
5.4.290.0030.07019.08
5.4.280.0100.05319.15
5.4.270.0100.05318.99
5.4.260.0200.05019.07
5.4.250.0170.07019.17
5.4.240.0030.06019.25
5.4.230.0170.04719.16
5.4.220.0100.05719.14
5.4.210.0070.06018.94
5.4.200.0030.05716.61
5.4.190.0230.03718.98
5.4.180.0200.06319.05
5.4.170.0170.05018.96
5.4.160.0130.05019.23
5.4.150.0100.05019.05
5.4.140.0030.06016.14
5.4.130.0170.04016.50
5.4.120.0130.04716.34
5.4.110.0070.06016.18
5.4.100.0070.05716.50
5.4.90.0030.05716.34
5.4.80.0130.04716.45
5.4.70.0100.05016.20
5.4.60.0030.05716.31
5.4.50.0070.06316.48
5.4.40.0070.05716.10
5.4.30.0200.03716.34
5.4.20.0130.05016.48
5.4.10.0170.04316.15
5.4.00.0030.05315.58
5.3.290.0070.05714.58
5.3.280.0230.04714.51
5.3.270.0030.06314.52
5.3.260.0070.06014.46
5.3.250.0130.05014.53
5.3.240.0130.04714.44
5.3.230.0200.07314.50
5.3.220.0130.04714.55
5.3.210.0130.05014.57
5.3.200.0200.04014.41
5.3.190.0200.04314.40
5.3.180.0130.04714.35
5.3.170.0100.05014.42
5.3.160.0100.04714.40
5.3.150.0100.05314.41
5.3.140.0200.04014.40
5.3.130.0100.06314.48
5.3.120.0130.05014.49
5.3.110.0070.06014.42
5.3.100.0130.04713.89
5.3.90.0130.06313.86
5.3.80.0170.04314.02
5.3.70.0100.05013.98
5.3.60.0000.06013.95
5.3.50.0200.04013.78
5.3.40.0070.05313.78
5.3.30.0100.05713.89
5.3.20.0070.05013.72
5.3.10.0070.05313.55
5.3.00.0100.05713.48
5.2.170.0130.03311.23
5.2.160.0030.04311.14
5.2.150.0070.04311.19
5.2.140.0070.04011.06
5.2.130.0070.04011.18
5.2.120.0130.03311.05
5.2.110.0100.03711.09
5.2.100.0030.04311.11
5.2.90.0000.05011.14
5.2.80.0070.04010.99
5.2.70.0130.03710.99
5.2.60.0100.04310.96
5.2.50.0000.05010.88
5.2.40.0130.03311.00
5.2.30.0070.04310.83
5.2.20.0030.05010.95
5.2.10.0030.04310.84
5.2.00.0070.04010.66
5.1.60.0030.0379.92
5.1.50.0070.0339.91
5.1.40.0030.0409.89
5.1.30.0030.04010.24
5.1.20.0170.04010.41
5.1.10.0100.03010.11
5.1.00.0130.0439.98
5.0.50.0030.0408.46
5.0.40.0030.0278.32
5.0.30.0030.0438.21
5.0.20.0030.0278.11
5.0.10.0070.0278.00
5.0.00.0000.0478.29
4.4.90.0030.0205.77
4.4.80.0030.0205.76
4.4.70.0070.0205.86
4.4.60.0100.0175.80
4.4.50.0030.0305.75
4.4.40.0070.0335.89
4.4.30.0100.0175.74
4.4.20.0030.0205.95
4.4.10.0070.0205.80
4.4.00.0070.0305.82
4.3.110.0070.0205.82
4.3.100.0030.0205.74
4.3.90.0030.0205.81
4.3.80.0030.0335.76
4.3.70.0030.0275.64
4.3.60.0070.0205.83
4.3.50.0130.0105.65
4.3.40.0030.0335.72
4.3.30.0000.0274.45
4.3.20.0030.0204.39
4.3.10.0000.0234.46
4.3.00.0030.0236.96

preferences:
67.32 ms | 403 KiB | 5 Q