3v4l.org

run code in 300+ PHP versions simultaneously
<?php $letters = array( array("a", "b", "c", "d", "e","1"), array("f", "g", "h", "i", "j","2"), array("k", "l", "m", "n", "o","3"), array("p", "r", "q", "s", "t","4"), array("u", "v", "w", "x", "y","5"), array("z", "0", "9", "8", "7","6")); $neighbour =array(-1, 0, 1); for($x[1] = 0; $x[1] < count($letters); ++$x[1]) { for($y[1] = 0; $y[1] < count($letters[$x[1]]); ++$y[1]) { echo $letters[$x[1]][$y[1]]."<br>"; foreach ($neighbour as $neigh){ $x[2]=$x[1]+$neigh; if ($x[2]>-1 AND $x[2]<count($letters) ) { foreach ($neighbour as $neigh){ $y[2]=$y[1]+$neigh; if ($y[2]>-1 AND $y[2]<count($letters[$x[2]])) { if ($x[2] != $x[1] OR $y[2] != $y[1]){ echo $letters[$x[1]][$y[1]].$letters[$x[2]][$y[2]]."<br>"; foreach ($neighbour as $neigh){ $x[3]=$x[2]+$neigh; if ($x[3]>-1 AND $x[3]<count($letters) ) { foreach ($neighbour as $neigh){ $y[3]=$y[2]+$neigh; if ($y[3]>-1 AND $y[3]<count($letters[$x[3]])) { if ($x[3] != $x[1] OR $y[3] != $y[1]){ if ($x[3] != $x[2] OR $y[3] != $y[2]){ echo $letters[$x[1]][$y[1]].$letters[$x[2]][$y[2]].$letters[$x[3]][$y[3]]."<br>"; foreach ($neighbour as $neigh){ $x[4]=$x[3]+$neigh; if ($x[4]>-1 AND $x[4]<count($letters) ) { foreach ($neighbour as $neigh){ $y[4]=$y[3]+$neigh; if ($y[4]>-1 AND $y[4]<count($letters[$x[4]])) { if ($x[4] != $x[1] OR $y[4] != $y[1]){ if ($x[4] != $x[2] OR $y[4] != $y[2]){ if ($x[4] != $x[3] OR $y[4] != $y[3]){ echo $letters[$x[1]][$y[1]].$letters[$x[2]][$y[2]]; echo $letters[$x[3]][$y[3]].$letters[$x[4]][$y[4]]."<br>"; foreach ($neighbour as $neigh){ $x[5]=$x[4]+$neigh; if ($x[5]>-1 AND $x[5]<count($letters) ) { foreach ($neighbour as $neigh){ $y[5]=$y[4]+$neigh; if ($y[5]>-1 AND $y[5]<count($letters[$x[5]])) { if ($x[5] != $x[1] OR $y[5] != $y[1]){ if ($x[5] != $x[2] OR $y[5] != $y[2]){ if ($x[5] != $x[3] OR $y[5] != $y[3]){ if ($x[5] != $x[4] OR $y[5] != $y[4]){ echo $letters[$x[1]][$y[1]].$letters[$x[2]][$y[2]]; echo $letters[$x[3]][$y[3]].$letters[$x[4]][$y[4]]; echo $letters[$x[5]][$y[5]]."<br>"; foreach ($neighbour as $neigh){ $x[6]=$x[5]+$neigh; if ($x[6]>-1 AND $x[6]<count($letters) ) { foreach ($neighbour as $neigh){ $y[6]=$y[5]+$neigh; if ($y[6]>-1 AND $y[6]<count($letters[$x[6]])) { if ($x[6] != $x[1] OR $y[6] != $y[1]){ if ($x[6] != $x[2] OR $y[6] != $y[2]){ if ($x[6] != $x[3] OR $y[6] != $y[3]){ if ($x[6] != $x[4] OR $y[6] != $y[4]){ if ($x[6] != $x[5] OR $y[6] != $y[5]){ echo $letters[$x[1]][$y[1]].$letters[$x[2]][$y[2]]; echo $letters[$x[3]][$y[3]].$letters[$x[4]][$y[4]]; echo $letters[$x[5]][$y[5]].$letters[$x[6]][$y[6]]."<br>"; foreach ($neighbour as $neigh){ $x[7]=$x[6]+$neigh; if ($x[7]>-1 AND $x[7]<count($letters) ) { foreach ($neighbour as $neigh){ $y[7]=$y[6]+$neigh; if ($y[7]>-1 AND $y[7]<count($letters[$x[7]])) { if ($x[7] != $x[1] OR $y[7] != $y[1]){ if ($x[7] != $x[2] OR $y[7] != $y[2]){ if ($x[7] != $x[3] OR $y[7] != $y[3]){ if ($x[7] != $x[4] OR $y[7] != $y[4]){ if ($x[7] != $x[5] OR $y[7] != $y[5]){ if ($x[7] != $x[6] OR $y[7] != $y[6]){ echo $letters[$x[1]][$y[1]].$letters[$x[2]][$y[2]]; echo $letters[$x[3]][$y[3]].$letters[$x[4]][$y[4]]; echo $letters[$x[5]][$y[5]].$letters[$x[6]][$y[6]]; echo $letters[$x[7]][$y[7]]."<br>"; }}}}}}}}}} }}}}}}}}} }}}}}}}} }}}}}}} }}}}}} }}}}} }} ?>

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.0290.01618.43
8.3.50.0450.00917.37
8.3.40.0450.00720.39
8.3.30.0390.00718.79
8.3.20.0330.01318.85
8.3.10.0230.02718.75
8.3.00.0350.00719.16
8.2.180.0330.01316.75
8.2.170.0420.00722.96
8.2.160.0400.00719.16
8.2.150.0180.00424.18
8.2.140.0180.00724.66
8.2.130.0220.00426.16
8.2.120.0360.01020.75
8.2.110.0180.00920.57
8.2.100.0380.01618.03
8.2.90.0130.00317.88
8.2.80.0140.00018.89
8.2.70.0130.00717.75
8.2.60.0070.00718.18
8.2.50.0160.00618.07
8.2.40.0070.01520.19
8.2.30.0090.00917.88
8.2.20.0130.01317.92
8.2.10.0090.00617.98
8.2.00.0190.00918.06
8.1.280.0170.02825.92
8.1.270.0220.00323.99
8.1.260.0240.02026.35
8.1.250.0460.02028.09
8.1.240.0170.01019.02
8.1.230.0230.00718.08
8.1.220.0030.01218.04
8.1.210.0120.00418.77
8.1.200.0230.00617.73
8.1.190.0220.00317.60
8.1.180.0090.00918.10
8.1.170.0140.00018.93
8.1.160.0100.01319.32
8.1.150.0080.00618.80
8.1.140.0160.00917.70
8.1.130.0070.00717.75
8.1.120.0070.00717.64
8.1.110.0070.00717.67
8.1.100.0100.00717.61
8.1.90.0140.00017.74
8.1.80.0030.01317.78
8.1.70.0060.00617.63
8.1.60.0030.01017.73
8.1.50.0090.00617.69
8.1.40.0070.01117.66
8.1.30.0190.00017.73
8.1.20.0140.01017.75
8.1.10.0070.00717.85
8.1.00.0060.01617.65
8.0.300.0200.00318.77
8.0.290.0100.01016.75
8.0.280.0150.01218.59
8.0.270.0180.00317.30
8.0.260.0210.01117.04
8.0.250.0160.00317.08
8.0.240.0070.00717.12
8.0.230.0000.01316.99
8.0.220.0110.00316.82
8.0.210.0070.00716.96
8.0.200.0040.01816.99
8.0.190.0090.00917.11
8.0.180.0070.01316.96
8.0.170.0040.01516.95
8.0.160.0070.00717.01
8.0.150.0070.01116.90
8.0.140.0110.01816.96
8.0.130.0180.00313.50
8.0.120.0230.01016.92
8.0.110.0030.01417.00
8.0.100.0140.00016.83
8.0.90.0000.01417.01
8.0.80.0410.05616.89
8.0.70.0100.00716.98
8.0.60.0110.00616.83
8.0.50.0100.01316.79
8.0.30.0720.04117.26
8.0.20.0610.04717.06
8.0.10.0030.01017.17
8.0.00.0870.03316.80
7.4.330.0090.00313.15
7.4.320.0060.00616.68
7.4.300.0130.00016.54
7.4.290.0070.01716.57
7.4.280.0030.01416.64
7.4.270.0030.01016.63
7.4.260.0180.00413.46
7.4.250.0040.01516.66
7.4.240.0070.01116.56
7.4.230.0240.01216.68
7.4.220.0260.03616.69
7.4.210.0260.02916.52
7.4.200.0110.01116.64
7.4.190.0060.00916.82
7.4.160.0550.06116.48
7.4.150.0710.06816.61
7.4.140.0910.02316.64
7.4.130.0760.04716.63
7.4.120.0750.07216.52
7.4.110.0980.05516.58
7.4.100.0720.05916.67
7.4.90.0630.07216.46
7.4.80.0300.05319.39
7.4.70.0590.04216.74
7.4.60.0250.03216.72
7.4.50.0100.00716.69
7.4.40.0200.01716.41
7.4.30.0340.03716.68
7.3.330.0130.01613.29
7.3.320.0060.02213.39
7.3.310.0070.00716.22
7.3.300.0070.01016.34
7.3.290.0140.04716.39
7.3.280.0330.04216.44
7.3.270.0820.04116.45
7.3.260.0810.05816.76
7.3.250.0600.03516.52
7.3.240.0630.04816.70
7.3.230.0620.05516.41
7.3.210.0880.05416.55
7.3.200.0620.04916.45
7.3.190.0390.06316.36
7.3.180.0580.06216.48
7.3.170.0480.04716.38
7.3.160.0700.04916.39
7.2.330.0770.04016.70
7.2.320.0420.04816.84
7.2.310.0390.03916.93
7.2.300.0540.05516.56
7.2.290.0550.04616.82
7.2.100.0510.03614.83
7.2.90.1580.04014.75
7.2.80.1590.02014.81
7.2.70.1690.03114.95
7.2.60.2050.06615.14
7.2.50.1590.02914.91
7.2.40.1780.03715.27
7.2.30.0940.03215.05
7.2.20.1870.02615.08
7.2.10.1310.01614.95
7.2.00.0390.01815.23
7.1.220.2650.03014.13
7.1.210.1610.04114.11
7.1.200.1820.02513.93
7.1.190.1420.03413.93
7.1.180.2160.03314.11
7.1.170.1610.02114.17
7.1.160.1790.03513.98
7.1.150.0870.02214.25
7.1.140.2370.02113.99
7.1.130.0420.02513.93
7.1.120.1620.02813.73
7.1.110.1440.04013.74
7.1.100.0770.01913.99
7.1.90.0710.03214.10
7.1.80.2510.01514.05
7.1.70.0720.02814.32
7.1.60.0840.02932.17
7.1.50.1130.01832.32
7.1.40.1500.02832.25
7.1.30.3370.04732.22
7.1.20.0700.01232.00
7.1.10.2060.01013.89
7.1.00.0680.04514.08
7.0.310.1560.02913.79
7.0.300.0460.03613.74
7.0.290.1840.02613.42
7.0.280.0400.04313.34
7.0.270.0530.03013.66
7.0.260.0420.02013.71
7.0.250.1510.02513.61
7.0.240.1410.02213.50
7.0.230.1850.01513.77
7.0.220.1670.05013.50
7.0.210.1410.03313.59
7.0.200.0830.03313.48
7.0.190.0570.04813.57
7.0.180.0270.02013.71
7.0.170.0500.02313.63
7.0.160.3300.02213.75
7.0.150.1150.00913.63
7.0.140.0820.02513.83
7.0.130.0230.03013.37
7.0.120.0530.04613.50
7.0.110.2370.01913.64
7.0.100.0750.03213.58
7.0.90.0840.01513.54
7.0.80.0440.01813.53
7.0.70.0960.02313.73
7.0.60.0460.02013.53
7.0.50.0410.02013.76
7.0.40.0730.01813.88
7.0.30.0520.04513.92
7.0.20.0590.01713.86
7.0.10.0330.02413.71
7.0.00.0300.03913.75
5.6.380.0380.03814.42
5.6.370.0340.03714.77
5.6.360.0340.03414.23
5.6.350.0230.03513.96
5.6.340.0440.02214.36
5.6.330.0330.02514.16
5.6.320.0330.03014.57
5.6.310.0330.04514.55
5.6.300.0300.03014.18
5.6.290.0320.03614.45
5.6.280.0300.03314.34
5.6.270.0430.02014.57
5.6.260.0410.03014.20
5.6.250.0350.03514.35
5.6.240.0370.02514.55
5.6.230.0260.02214.46
5.6.220.0310.03114.11
5.6.210.0440.02114.41
5.6.200.0370.02714.27
5.6.190.0470.02514.62
5.6.180.0330.03014.12
5.6.170.0360.03314.36
5.6.160.0320.02614.38
5.6.150.0620.04614.37
5.6.140.0440.03014.31
5.6.130.0460.03114.17
5.6.120.0450.02514.43
5.6.110.0240.05314.46
5.6.100.0340.03414.76
5.6.90.0390.01614.69
5.6.80.0510.03814.66
5.6.70.0310.05014.70
5.6.60.0440.03714.45
5.5.380.0400.02912.13
5.5.370.0510.01912.13
5.5.360.0310.03112.13
5.5.350.0310.02912.13
5.5.340.0410.02412.13
5.5.330.0330.02412.13
5.5.320.0360.05912.13
5.5.310.0450.03912.13
5.5.300.0320.03512.13
5.5.290.0430.06812.13
5.5.280.0480.01712.13
5.5.270.0220.02212.13
5.5.260.0410.05512.13
5.5.250.0360.01912.13
5.5.240.0330.04112.13
5.5.230.0380.02912.13
5.4.450.0430.03112.13
5.4.440.0510.03112.13
5.4.430.0350.02212.13
5.4.420.0280.04912.13
5.4.410.0420.02912.13
5.4.400.0450.02812.13
5.4.390.0440.04112.13

preferences:
37.62 ms | 401 KiB | 5 Q