3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Declare the suits $suits = array ( "Spades", "Hearts", "Clubs", "Diamonds" ); // Declare the faces $faces = array ( "Two"=>2, "Three"=>3, "Four"=>4, "Five"=>5, "Six"=>6, "Seven"=>7, "Eight"=>8, "Nine"=>9, "Ten"=>10, "Jack"=>10, "Queen"=>10, "King"=>10, "Ace"=>11 ); // create deck array // get all suits which has foreach($suits as $suit) { // get all the keys frok faces // now $keys = array_key($faces); // loop through the keys as faces foreach ($keys as $face) { // declare the deck array $deck = ['face' => $face, 'suit' => $suit]; var_dump($deck); } foreach($faces as $face => $value) { $deck = ['face' => $face, 'suit' => $suit ]; } var_dump($deck); }

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.0060.00916.63
8.3.50.0100.01121.07
8.3.40.0040.01118.79
8.3.30.0060.01218.83
8.3.20.0060.00320.35
8.3.10.0110.00423.48
8.3.00.0040.00423.61
8.2.180.0060.00918.38
8.2.170.0000.01422.96
8.2.160.0070.01022.20
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0090.00017.75
8.2.110.0050.00521.18
8.2.100.0100.00317.60
8.2.90.0080.00018.95
8.2.80.0080.00017.97
8.2.70.0030.00617.50
8.2.60.0050.00317.80
8.2.50.0030.00618.07
8.2.40.0060.00320.85
8.2.30.0070.00419.85
8.2.20.0020.00517.68
8.2.10.0040.00418.17
8.2.00.0000.00718.15
8.1.280.0090.00925.92
8.1.270.0040.00420.43
8.1.260.0070.00026.35
8.1.250.0020.00528.09
8.1.240.0060.00322.65
8.1.230.0040.00817.79
8.1.220.0090.00017.74
8.1.210.0030.00618.77
8.1.200.0060.00317.22
8.1.190.0060.00317.35
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0000.00721.89
8.1.150.0080.00018.90
8.1.140.0040.00417.30
8.1.130.0070.00017.73
8.1.120.0000.00817.49
8.1.110.0000.00717.38
8.1.100.0030.00317.46
8.1.90.0040.00417.34
8.1.80.0040.00417.43
8.1.70.0080.00017.43
8.1.60.0040.00417.57
8.1.50.0000.00717.52
8.1.40.0060.00317.41
8.1.30.0050.00317.45
8.1.20.0030.00517.71
8.1.10.0060.00317.59
8.1.00.0040.00417.41
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0030.00518.47
8.0.270.0070.00017.29
8.0.260.0070.00017.20
8.0.250.0040.00417.00
8.0.240.0030.00317.00
8.0.230.0000.00817.02
8.0.220.0040.00416.82
8.0.210.0000.00716.86
8.0.200.0000.00816.88
8.0.190.0000.00717.04
8.0.180.0000.00716.89
8.0.170.0070.00016.98
8.0.160.0030.00317.00
8.0.150.0000.00716.88
8.0.140.0000.00716.92
8.0.130.0030.00613.38
8.0.120.0050.00216.90
8.0.110.0040.00416.84
8.0.100.0000.00716.93
8.0.90.0050.00316.94
8.0.80.0090.01316.94
8.0.70.0050.00316.84
8.0.60.0040.00416.91
8.0.50.0070.00016.76
8.0.30.0090.00816.89
8.0.20.0120.00617.40
8.0.10.0000.00717.05
8.0.00.0150.00616.83
7.4.330.0050.00015.13
7.4.320.0060.00016.49
7.4.300.0060.00016.58
7.4.290.0090.00016.50
7.4.280.0070.00016.50
7.4.270.0030.00316.50
7.4.260.0000.00716.46
7.4.250.0040.00416.32
7.4.240.0030.00416.62
7.4.230.0030.00316.41
7.4.220.0000.01916.63
7.4.210.0100.00816.57
7.4.200.0040.00416.63
7.4.160.0050.01016.50
7.4.150.0100.00717.40
7.4.140.0100.01417.86
7.4.130.0090.00816.55
7.4.120.0080.01316.72
7.4.110.0000.01716.47
7.4.100.0110.00716.51
7.4.90.0190.00016.52
7.4.80.0090.01419.39
7.4.70.0140.00316.50
7.4.60.0110.00716.52
7.4.50.0100.00016.34
7.4.40.0070.01016.54
7.4.30.0110.01116.66
7.4.00.0040.01215.02
7.3.330.0020.00213.23
7.3.320.0050.00013.16
7.3.310.0070.00016.45
7.3.300.0030.00316.37
7.3.290.0030.00316.34
7.3.280.0120.00916.34
7.3.270.0100.00717.40
7.3.260.0080.00916.36
7.3.250.0130.01716.34
7.3.240.0060.01216.37
7.3.230.0120.00616.39
7.3.210.0140.00616.30
7.3.200.0080.00816.29
7.3.190.0100.01016.52
7.3.180.0100.00716.34
7.3.170.0100.01216.34
7.3.160.0130.00916.54
7.3.120.0030.00914.74
7.3.110.0110.00714.63
7.3.100.0030.01214.95
7.3.90.0070.01014.88
7.3.80.0000.01414.63
7.3.70.0030.01314.60
7.3.60.0130.00014.89
7.3.50.0040.00814.75
7.3.40.0060.00614.68
7.3.30.0000.00914.72
7.3.20.0030.01016.69
7.3.10.0060.00616.59
7.3.00.0090.00316.63
7.2.330.0110.00516.74
7.2.320.0040.01316.32
7.2.310.0090.00616.57
7.2.300.0090.00916.56
7.2.290.0070.01116.64
7.2.250.0060.01514.71
7.2.240.0170.00314.58
7.2.230.0040.01514.82
7.2.220.0060.00914.93
7.2.210.0090.00614.87
7.2.200.0000.01214.75
7.2.190.0060.00315.02
7.2.180.0030.01014.94
7.2.170.0090.00314.95
7.2.60.0030.01216.97
7.2.00.0090.00319.07
7.1.330.0030.01015.69
7.1.320.0030.01415.46
7.1.310.0000.01915.77
7.1.300.0030.01015.78
7.1.290.0040.00815.65
7.1.280.0070.00415.71
7.1.270.0080.00615.63
7.1.260.0040.01115.78
7.1.200.0000.01215.63
7.1.100.0040.00717.71
7.1.70.0060.00616.68
7.1.60.0080.00419.12
7.1.50.0000.01916.93
7.1.00.0100.07022.57
7.0.200.0150.00314.63
7.0.60.0330.06019.78
7.0.50.0070.08017.77
7.0.40.0070.07020.21
7.0.30.0200.06020.33
7.0.20.0170.04720.17
7.0.10.0030.08720.00
7.0.00.0030.08720.05
5.6.280.0100.07021.07
5.6.210.0070.05320.67
5.6.200.0070.08718.19
5.6.190.0100.04020.41
5.6.180.0430.04720.47
5.6.170.0270.04020.48
5.6.160.0030.04320.51
5.6.150.0130.05718.22
5.6.140.0070.07018.18
5.6.130.0100.05318.14
5.6.120.0070.05021.08
5.6.110.0100.07721.14
5.6.100.0000.09021.02
5.6.90.0070.07320.95
5.6.80.0070.05320.29
5.5.350.0170.07020.39
5.5.340.0100.03317.92
5.5.330.0030.05320.07
5.5.320.0230.04020.21
5.5.310.0400.07720.29
5.5.300.0030.08317.90
5.5.290.0100.06317.98
5.5.280.0100.08020.96
5.5.270.0170.04320.75
5.5.260.0030.07020.97
5.5.250.0030.04020.46
5.5.240.0070.07720.26
5.4.450.0400.06319.09
5.4.440.0270.05319.58
5.4.430.0230.05319.49
5.4.420.0200.06719.46
5.4.410.0270.04719.50
5.4.400.0130.06719.23
5.4.390.0170.05319.15
5.4.380.0100.06018.94
5.4.370.0230.06318.98
5.4.360.0170.05718.78
5.4.350.0270.04718.92
5.4.340.0230.05718.98
5.4.320.0300.04319.14
5.4.310.0130.05319.11
5.4.300.0170.05019.26
5.4.290.0170.06719.14
5.4.280.0100.06019.14
5.4.270.0270.04318.76
5.4.260.0300.04718.78
5.4.250.0200.06319.29
5.4.240.0270.04319.13
5.4.230.0130.05719.25
5.4.220.0270.04718.77
5.4.210.0270.04719.09
5.4.200.0130.06316.71
5.4.190.0230.05018.97
5.4.180.0200.06019.07
5.4.170.0170.06318.92
5.4.160.0130.06019.17
5.4.150.0270.04318.78
5.4.140.0270.04316.39
5.4.130.0270.05016.21
5.4.120.0130.05316.47
5.4.110.0200.04716.43
5.4.100.0100.06016.48
5.4.90.0170.05316.52
5.4.80.0170.05016.23
5.4.70.0200.06316.40
5.4.60.0130.06016.25
5.4.50.0270.05316.31
5.4.40.0200.05316.15
5.4.30.0270.04316.39
5.4.20.0230.05016.45
5.4.10.0170.05016.34
5.4.00.0200.04715.84
5.3.290.0130.05314.51
5.3.280.0200.04714.39
5.3.270.0070.06014.54
5.3.260.0230.05314.49
5.3.250.0130.06014.45
5.3.240.0200.05314.56
5.3.230.0330.03714.44
5.3.220.0170.05014.41
5.3.210.0270.04314.52
5.3.200.0200.06314.40
5.3.190.0200.07314.47
5.3.180.0230.05314.52
5.3.170.0130.05014.51
5.3.160.0130.05314.41
5.3.150.0300.06314.41
5.3.140.0270.05314.53
5.3.130.0170.05714.39
5.3.120.0270.06314.43
5.3.110.0270.04314.38
5.3.100.0130.06013.98
5.3.90.0100.06014.04
5.3.80.0170.05313.86
5.3.70.0230.04314.04
5.3.60.0130.06013.78
5.3.50.0170.05013.90
5.3.40.0230.05013.90
5.3.30.0270.05713.69
5.3.20.0270.03713.57
5.3.10.0100.05313.75
5.3.00.0070.06013.58
5.2.170.0170.04010.94
5.2.160.0170.03710.94
5.2.150.0130.04311.09
5.2.140.0170.05011.29
5.2.130.0070.04711.04
5.2.120.0170.04310.99
5.2.110.0130.05011.17
5.2.100.0030.06011.05
5.2.90.0100.04311.07
5.2.80.0100.04711.04
5.2.70.0130.04310.93
5.2.60.0230.03710.96
5.2.50.0200.03310.91
5.2.40.0170.03310.98
5.2.30.0030.04310.92
5.2.20.0170.03710.98
5.2.10.0130.03311.02
5.2.00.0100.04010.69
5.1.60.0100.03310.02
5.1.50.0130.0409.94
5.1.40.0070.05010.07
5.1.30.0130.05010.24
5.1.20.0170.04010.40
5.1.10.0230.03310.09
5.1.00.0130.04310.14
5.0.50.0070.0278.57
5.0.40.0100.0238.30
5.0.30.0030.0508.06
5.0.20.0100.0278.28
5.0.10.0030.0438.04
5.0.00.0030.0608.09
4.4.90.0130.0236.09
4.4.80.0070.0276.09
4.4.70.0100.0206.09
4.4.60.0070.0306.09
4.4.50.0100.0206.09
4.4.40.0230.0336.09
4.4.30.0170.0206.09
4.4.20.0070.0306.09
4.4.10.0170.0176.09
4.4.00.0070.0406.09
4.3.110.0130.0236.09
4.3.100.0100.0206.09
4.3.90.0130.0236.09
4.3.80.0270.0376.09
4.3.70.0130.0176.09
4.3.60.0070.0276.09
4.3.50.0130.0276.09
4.3.40.0070.0336.09
4.3.30.0070.0236.09
4.3.20.0030.0276.09
4.3.10.0100.0236.09
4.3.00.0100.0138.46

preferences:
62.79 ms | 401 KiB | 5 Q