3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <!-- Bootstrap --> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <?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)
5.6.120.0070.05020.98
5.6.110.0030.06321.14
5.6.100.0030.08321.02
5.6.90.0100.07021.10
5.6.80.0030.08020.50
5.6.70.4230.03720.46
5.5.280.0100.08020.77
5.5.270.0170.06720.89
5.5.260.0130.08020.80
5.5.250.0070.06320.71
5.5.240.0200.06720.36
5.4.440.0930.04719.46
5.4.430.0230.04719.55
5.4.420.0070.05319.55
5.4.410.0830.05319.40
5.4.400.0730.05319.24
5.4.390.0170.06019.00
5.4.380.0670.04719.00
5.4.370.0800.06719.30
5.4.360.0600.07019.23
5.4.350.0270.06018.86
5.4.340.0100.06019.05
5.4.320.1000.05019.23
5.4.310.1030.05719.12
5.4.300.0770.04719.20
5.4.290.0830.06318.83
5.4.280.0900.08019.13
5.4.270.0800.07319.04
5.4.260.1070.05719.00
5.4.250.1000.05019.20
5.4.240.0930.04719.04
5.4.230.0700.05319.20
5.4.220.1000.06319.11
5.4.210.1100.07319.00
5.4.200.0800.05316.92
5.4.190.0930.05019.30
5.4.180.0730.06719.00
5.4.170.0130.06719.01
5.4.160.0270.05319.00
5.4.150.0170.05718.90
5.4.140.0200.05316.44
5.4.130.0230.04716.39
5.4.120.0230.04016.34
5.4.110.0170.05016.55
5.4.100.0270.04316.53
5.4.90.0200.06016.27
5.4.80.0100.06016.51
5.4.70.0100.06016.42
5.4.60.0230.04716.54
5.4.50.0200.06716.30
5.4.40.0330.04016.40
5.4.30.0270.04716.35
5.4.20.0270.04316.41
5.4.10.0270.04716.37
5.4.00.0170.05015.88
5.3.290.0100.06014.51
5.3.280.0170.05714.69
5.3.270.0130.06014.59
5.3.260.0200.06014.42
5.3.250.0100.05714.45
5.3.240.0000.06714.40
5.3.230.0070.06314.46
5.3.220.0100.05714.55
5.3.210.0300.04014.45
5.3.200.0100.06314.41
5.3.190.0200.05314.43
5.3.180.0270.04314.52
5.3.170.0100.05714.52
5.3.160.0130.05314.55
5.3.150.0130.05714.36
5.3.140.0200.05014.39
5.3.130.0200.05714.39
5.3.120.0230.05014.54
5.3.110.0330.05014.56
5.3.100.0170.05714.14
5.3.90.0200.05313.88
5.3.80.0230.05013.96
5.3.70.0230.05313.96
5.3.60.0100.05713.88
5.3.50.0130.06013.93
5.3.40.0170.05013.72
5.3.30.0170.05713.86
5.3.20.0030.06013.65
5.3.10.0200.04713.61
5.3.00.0200.04713.59
5.2.170.0130.04311.10
5.2.160.0200.03010.99
5.2.150.0170.04011.09
5.2.140.0130.04311.00
5.2.130.0270.03311.20
5.2.120.0170.04010.96
5.2.110.0000.05711.26
5.2.100.0200.03711.00
5.2.90.0100.04711.04
5.2.80.0170.03710.95
5.2.70.0170.04011.13
5.2.60.0170.05311.10
5.2.50.0070.05010.96
5.2.40.0070.04710.79
5.2.30.0130.04310.95
5.2.20.0130.04010.95
5.2.10.0130.04011.04
5.2.00.0200.04010.77
5.1.60.0070.0379.89
5.1.50.0070.0439.92
5.1.40.0030.0439.85
5.1.30.0100.04010.49
5.1.20.0070.04010.52
5.1.10.0170.03310.01
5.1.00.0100.0379.95
5.0.50.0070.0338.63
5.0.40.0070.0338.32
5.0.30.0100.0378.17
5.0.20.0030.0408.12
5.0.10.0030.0308.25
5.0.00.0130.0478.05
4.4.90.0100.0236.07
4.4.80.0030.0236.07
4.4.70.0030.0276.07
4.4.60.0030.0236.07
4.4.50.0070.0206.07
4.4.40.0070.0376.07
4.4.30.0070.0206.07
4.4.20.0030.0276.07
4.4.10.0100.0276.07
4.4.00.0130.0276.07
4.3.110.0030.0306.07
4.3.100.0070.0206.07
4.3.90.0130.0176.07
4.3.80.0070.0476.07
4.3.70.0130.0236.07
4.3.60.0070.0306.07
4.3.50.0030.0306.07
4.3.40.0100.0406.07
4.3.30.0030.0306.07
4.3.20.0100.0236.07
4.3.10.0070.0176.07
4.3.00.0200.0208.46

preferences:
138.52 ms | 1398 KiB | 7 Q