3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_list_view_html($product) { $output = ""; $output = $output . "<li>"; $output = $output . '<a href="' . BASE_URL . 'shirts/' . $product["sku"] . '/">'; $output = $output . '<img src="' . BASE_URL . $product["img"] . '" alt="' . $product["name"] . '">'; $output = $output . "<p>View Details</p>"; $output = $output . "</a>"; $output = $output . "</li>"; return $output; } function get_product_count() { } function get_products_recent() { $recent = array(); $all = get_products_all(); $total_products = count($all); $position = 0; foreach($all as $product) { $position = $position + 1; if ($total_products - $position < 4) { $recent[] = $product; } } return $recent; } function get_products_search($s) { $results = array(); $all = get_products_all(); foreach($all as $product) { if (stripos($product["name"],$s) !== false) { $results[] = $product; } } return $results; } function get_products_all() { $products = array(); $products[101] = array( "name" => "Logo Shirt, Red", "img" => "img/shirts/shirt-101.jpg", "price" => 18, "paypal" => "9P7DLECFD4LKE", "sizes" => array("Small","Medium","Large","X-Large") ); $products[102] = array( "name" => "Mike the Frog Shirt, Black", "img" => "img/shirts/shirt-102.jpg", "price" => 20, "paypal" => "SXKPTHN2EES3J", "sizes" => array("Small","Medium","Large","X-Large") ); $products[103] = array( "name" => "Mike the Frog Shirt, Blue", "img" => "img/shirts/shirt-103.jpg", "price" => 20, "paypal" => "7T8LK5WXT5Q9J", "sizes" => array("Small","Medium","Large","X-Large") ); $products[104] = array( "name" => "Logo Shirt, Green", "img" => "img/shirts/shirt-104.jpg", "price" => 18, "paypal" => "YKVL5F87E8PCS", "sizes" => array("Small","Medium","Large","X-Large") ); $products[105] = array( "name" => "Mike the Frog Shirt, Yellow", "img" => "img/shirts/shirt-105.jpg", "price" => 25, "paypal" => "4CLP2SCVYM288", "sizes" => array("Small","Medium","Large","X-Large") ); $products[106] = array( "name" => "Logo Shirt, Gray", "img" => "img/shirts/shirt-106.jpg", "price" => 20, "paypal" => "TNAZ2RGYYJ396", "sizes" => array("Small","Medium","Large","X-Large") ); $products[107] = array( "name" => "Logo Shirt, Teal", "img" => "img/shirts/shirt-107.jpg", "price" => 20, "paypal" => "S5FMPJN6Y2C32", "sizes" => array("Small","Medium","Large","X-Large") ); $products[108] = array( "name" => "Mike the Frog Shirt, Orange", "img" => "img/shirts/shirt-108.jpg", "price" => 25, "paypal" => "JMFK7P7VEHS44", "sizes" => array("Large","X-Large") ); $products[109] = array( "name" => "Get Coding Shirt, Gray", "img" => "img/shirts/shirt-109.jpg", "price" => 20, "paypal" => "B5DAJHWHDA4RC", "sizes" => array("Small","Medium","Large","X-Large") ); $products[110] = array( "name" => "HTML5 Shirt, Orange", "img" => "img/shirts/shirt-110.jpg", "price" => 22, "paypal" => "6T2LVA8EDZR8L", "sizes" => array("Small","Medium","Large","X-Large") ); $products[111] = array( "name" => "CSS3 Shirt, Gray", "img" => "img/shirts/shirt-111.jpg", "price" => 22, "paypal" => "MA2WQGE2KCWDS", "sizes" => array("Small","Medium","Large","X-Large") ); $products[112] = array( "name" => "HTML5 Shirt, Blue", "img" => "img/shirts/shirt-112.jpg", "price" => 22, "paypal" => "FWR955VF5PALA", "sizes" => array("Small","Medium","Large","X-Large") ); $products[113] = array( "name" => "CSS3 Shirt, Black", "img" => "img/shirts/shirt-113.jpg", "price" => 22, "paypal" => "4ELH2M2FW7272", "sizes" => array("Small","Medium","Large","X-Large") ); $products[114] = array( "name" => "PHP Shirt, Yellow", "img" => "img/shirts/shirt-114.jpg", "price" => 24, "paypal" => "AT3XQ3ZVP2DZG", "sizes" => array("Small","Medium","Large","X-Large") ); $products[115] = array( "name" => "PHP Shirt, Purple", "img" => "img/shirts/shirt-115.jpg", "price" => 24, "paypal" => "LYESEKV9JWE3A", "sizes" => array("Small","Medium","Large","X-Large") ); $products[116] = array( "name" => "PHP Shirt, Green", "img" => "img/shirts/shirt-116.jpg", "price" => 24, "paypal" => "KT7MRRJUXZR34", "sizes" => array("Small","Medium","Large","X-Large") ); $products[117] = array( "name" => "Get Coding Shirt, Red", "img" => "img/shirts/shirt-117.jpg", "price" => 20, "paypal" => "5UXJG8PXRXFKE", "sizes" => array("Small","Medium","Large","X-Large") ); $products[118] = array( "name" => "Mike the Frog Shirt, Purple", "img" => "img/shirts/shirt-118.jpg", "price" => 25, "paypal" => "KHP8PYPDZZFTA", "sizes" => array("Small","Medium","Large","X-Large") ); $products[119] = array( "name" => "CSS3 Shirt, Purple", "img" => "img/shirts/shirt-119.jpg", "price" => 22, "paypal" => "BFJRFE24L93NW", "sizes" => array("Small","Medium","Large","X-Large") ); $products[120] = array( "name" => "HTML5 Shirt, Red", "img" => "img/shirts/shirt-120.jpg", "price" => 22, "paypal" => "RUVJSBR9FXXWQ", "sizes" => array("Small","Medium","Large","X-Large") ); $products[122] = array( "name" => "PHP Shirt, Gray", "img" => "img/shirts/shirt-122.jpg", "price" => 24, "paypal" => "PYR4QH97W2TSJ", "sizes" => array("Small","Medium","Large","X-Large") ); $products[123] = array( "name" => "Mike the Frog Shirt, Green", "img" => "img/shirts/shirt-123.jpg", "price" => 25, "paypal" => "STDAUJJTSPT54", "sizes" => array("Small","Medium","Large","X-Large") ); $products[124] = array( "name" => "Logo Shirt, Yellow", "img" => "img/shirts/shirt-124.jpg", "price" => 20, "paypal" => "2R2U74KWU5RXG", "sizes" => array("Small","Medium","Large","X-Large") ); $products[125] = array( "name" => "CSS3 Shirt, Blue", "img" => "img/shirts/shirt-125.jpg", "price" => 22, "paypal" => "GJG7F8EW3XFAS", "sizes" => array("Small","Medium","Large","X-Large") ); $products[126] = array( "name" => "Doctype Shirt, Green", "img" => "img/shirts/shirt-126.jpg", "price" => 25, "paypal" => "QW2LFRYGU7L4Q", "sizes" => array("Small","Medium","Large","X-Large") ); $products[127] = array( "name" => "Logo Shirt, Purple", "img" => "img/shirts/shirt-127.jpg", "price" => 20, "paypal" => "GFV6QVRMJU7F8", "sizes" => array("Small","Medium","Large","X-Large") ); $products[128] = array( "name" => "Doctype Shirt, Purple", "img" => "img/shirts/shirt-128.jpg", "price" => 25, "paypal" => "BARQMHMB565PN", "sizes" => array("Small","Medium","Large","X-Large") ); $products[129] = array( "name" => "Get Coding Shirt, Green", "img" => "img/shirts/shirt-129.jpg", "price" => 20, "paypal" => "DH9GXABU3P8GS", "sizes" => array("Small","Medium","Large","X-Large") ); $products[130] = array( "name" => "HTML5 Shirt, Teal", "img" => "img/shirts/shirt-130.jpg", "price" => 22, "paypal" => "4LZ3EUVCBENE4", "sizes" => array("Small","Medium","Large","X-Large") ); $products[131] = array( "name" => "Logo Shirt, Orange", "img" => "img/shirts/shirt-131.jpg", "price" => 20, "paypal" => "7BNDYJBKWD364", "sizes" => array("Small","Medium","Large","X-Large") ); $products[132] = array( "name" => "Mike the Frog Shirt, Red", "img" => "img/shirts/shirt-132.jpg", "price" => 25, "paypal" => "Y6EQRE445MYYW", "sizes" => array("Small","Medium","Large","X-Large") ); foreach ($products as $product_id => $product) { $products[$product_id]["sku"] = $product_id; } return $products; } ?>

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.70.0030.01318.39
8.3.60.0090.00616.63
8.3.50.0110.00922.82
8.3.40.0140.00418.65
8.3.30.0080.00819.04
8.3.20.0080.00020.28
8.3.10.0110.00423.70
8.3.00.0080.00019.13
8.2.180.0060.01016.75
8.2.170.0100.00722.96
8.2.160.0070.01120.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0070.00020.95
8.2.110.0070.00320.52
8.2.100.0040.00817.94
8.2.90.0030.00618.96
8.2.80.0050.00317.97
8.2.70.0000.00817.23
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0040.00419.62
8.2.30.0040.00419.54
8.2.20.0000.00817.62
8.2.10.0000.00718.14
8.2.00.0000.00817.76
8.1.280.0120.00625.92
8.1.270.0000.00823.91
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00421.99
8.1.230.0070.00319.21
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.13
8.1.190.0000.00817.23
8.1.180.0030.00618.10
8.1.170.0060.00318.78
8.1.160.0040.00421.92
8.1.150.0000.00818.90
8.1.140.0080.00017.46
8.1.130.0000.00717.87
8.1.120.0050.00217.45
8.1.110.0000.00817.42
8.1.100.0040.00417.41
8.1.90.0070.00017.33
8.1.80.0050.00317.33
8.1.70.0070.00017.30
8.1.60.0060.00317.51
8.1.50.0040.00417.49
8.1.40.0050.00217.42
8.1.30.0040.00417.59
8.1.20.0040.00417.55
8.1.10.0080.00017.48
8.1.00.0000.00817.39
8.0.300.0030.00618.77
8.0.290.0050.00316.63
8.0.280.0020.00518.41
8.0.270.0030.00317.09
8.0.260.0060.00017.14
8.0.250.0070.00016.98
8.0.240.0000.00816.85
8.0.230.0040.00416.93
8.0.220.0000.00816.84
8.0.210.0030.00316.70
8.0.200.0000.00816.87
8.0.190.0040.00416.91
8.0.180.0000.00816.77
8.0.170.0000.00716.85
8.0.160.0000.00716.71
8.0.150.0080.00016.71
8.0.140.0040.00416.64
8.0.130.0030.00513.32
8.0.120.0040.00416.81
8.0.110.0000.00716.82
8.0.100.0000.00716.79
8.0.90.0080.00016.92
8.0.80.0080.01116.84
8.0.70.0000.00716.74
8.0.60.0050.00316.78
8.0.50.0080.00016.75
8.0.30.0060.01716.96
8.0.20.0070.01317.40
8.0.10.0080.00017.02
8.0.00.0100.00816.58
7.4.330.0000.00515.00
7.4.320.0030.00316.55
7.4.300.0100.00016.43
7.4.290.0000.00816.58
7.4.280.0040.00716.51
7.4.270.0070.00016.44
7.4.260.0030.00316.60
7.4.250.0040.00416.52
7.4.240.0020.00616.38
7.4.230.0000.00816.39
7.4.220.0060.01216.52
7.4.210.0100.00616.59
7.4.200.0030.00316.33
7.4.160.0090.00616.59
7.4.150.0140.01017.40
7.4.140.0150.00817.86
7.4.130.0080.01116.54
7.4.120.0070.01216.44
7.4.110.0150.00416.77
7.4.100.0060.01216.44
7.4.90.0090.00916.55
7.4.80.0100.00719.39
7.4.70.0140.00716.46
7.4.60.0140.01116.48
7.4.50.0040.00416.18
7.4.40.0100.00716.34
7.4.30.0050.01116.34
7.4.00.0030.01014.91
7.3.330.0000.00513.19
7.3.320.0000.00613.22
7.3.310.0000.00716.12
7.3.300.0030.00316.33
7.3.290.0000.02016.24
7.3.280.0110.00516.27
7.3.270.0170.01017.40
7.3.260.0070.01716.48
7.3.250.0120.00516.26
7.3.240.0130.00616.36
7.3.230.0150.00416.39
7.3.210.0120.00616.52
7.3.200.0100.01019.39
7.3.190.0150.00616.27
7.3.180.0100.00716.45
7.3.170.0120.00916.38
7.3.160.0030.01316.52
7.2.330.0130.01116.65
7.2.320.0030.01316.66
7.2.310.0190.00316.35
7.2.300.0060.01616.52
7.2.290.0130.01016.38
7.2.60.0130.00316.62
7.2.00.0060.00619.00
7.1.200.0070.00715.64
7.1.100.0040.00817.89
7.1.70.0040.00416.84
7.1.60.0200.00719.40
7.1.50.0070.01416.95
7.1.00.0070.07322.28
7.0.200.0000.01016.50
7.0.140.0130.06722.01
7.0.60.0130.07320.17
7.0.50.0030.08317.97
7.0.40.0100.08320.30
7.0.30.0600.07320.20
7.0.20.0330.07020.29
7.0.10.0070.08720.19
7.0.00.0030.05720.20
5.6.280.0100.07021.25
5.6.210.0030.08720.63
5.6.200.0130.07718.16
5.6.190.0070.09020.48
5.6.180.0430.07020.63
5.6.170.0200.04720.51
5.6.160.0100.09020.52
5.6.150.0130.03318.27
5.6.140.0200.02718.27
5.6.130.0070.07318.24
5.6.120.0100.08721.24
5.6.110.0070.08720.99
5.6.100.0070.08321.08
5.6.90.0000.05321.07
5.6.80.0070.05720.48
5.5.350.0100.07020.53
5.5.340.0130.04018.03
5.5.330.0030.04320.38
5.5.320.0470.07720.19
5.5.310.0130.05720.34
5.5.300.0100.04318.16
5.5.290.0170.06318.15
5.5.280.0170.07720.89
5.5.270.0100.04320.82
5.5.260.0170.07720.77
5.5.250.0000.08020.71
5.5.240.4200.03720.17
5.4.450.0130.04719.61
5.4.440.0270.05019.31
5.4.430.0200.06719.30
5.4.420.0230.07319.66
5.4.410.0230.04319.07
5.4.400.0370.06019.27
5.4.390.0300.06319.02
5.4.380.0230.07019.03
5.4.370.0200.04719.26
5.4.360.0230.03719.20
5.4.350.0200.03719.19
5.4.340.0330.06019.34
5.4.320.0230.07319.11
5.4.310.0200.05719.14
5.4.300.0100.05018.90
5.4.290.0230.05319.09
5.4.280.0300.06718.99
5.4.270.0230.04319.16
5.4.260.0230.04319.04
5.4.250.0170.04019.02
5.4.240.0170.04719.10
5.4.230.0230.03719.33
5.4.220.0200.04719.02
5.4.210.0230.06019.19
5.4.200.0170.04719.23
5.4.190.0330.05719.33
5.4.180.0170.05019.10
5.4.170.0170.04019.33
5.4.160.0130.04319.18
5.4.150.0170.05018.98
5.4.140.0130.05016.56
5.4.130.0270.06016.45
5.4.120.0230.04016.43
5.4.110.0200.03716.53
5.4.100.0330.03016.64
5.4.90.0270.06716.33
5.4.80.0200.04316.34
5.4.70.0130.05016.55
5.4.60.0230.04016.57
5.4.50.0170.05716.44
5.4.40.0200.07316.54
5.4.30.0130.03716.40
5.4.20.0200.04016.40
5.4.10.0230.03316.49
5.4.00.0230.04315.85
5.3.290.0130.04714.80
5.3.280.0130.04714.67
5.3.270.0170.06014.78
5.3.260.0170.04714.59
5.3.250.0200.06314.77
5.3.240.0170.04014.81
5.3.230.0200.04714.57
5.3.220.0230.05014.64
5.3.210.0170.06714.63
5.3.200.0130.04314.59
5.3.190.0300.05314.63
5.3.180.0200.03714.59
5.3.170.0270.05314.59
5.3.160.0230.06014.68
5.3.150.0370.05714.63
5.3.140.0270.06714.54
5.3.130.0270.04314.61
5.3.120.0230.04014.68
5.3.110.0200.03714.59
5.3.100.0130.04314.21
5.3.90.0270.03714.20
5.3.80.0200.06314.20
5.3.70.0170.03714.20
5.3.60.0200.07314.20
5.3.50.0300.06314.20
5.3.40.0230.06314.20
5.3.30.0270.07714.20
5.3.20.0270.03714.20
5.3.10.0270.07314.20
5.3.00.0270.04014.20
5.2.170.0170.06014.20
5.2.160.0230.03314.20
5.2.150.0230.05014.20
5.2.140.0230.05714.20
5.2.130.0200.03014.20
5.2.120.0130.03014.20
5.2.110.0200.03714.20
5.2.100.0230.03714.20
5.2.90.0170.03014.20
5.2.80.0200.03014.20
5.2.70.0130.03014.20
5.2.60.0330.04714.20
5.2.50.0230.04014.20
5.2.40.0230.05314.20
5.2.30.0270.03714.20
5.2.20.0200.02714.20
5.2.10.0230.05314.20
5.2.00.0130.03014.20
5.1.60.0200.03014.20
5.1.50.0300.02014.20
5.1.40.0200.04714.20
5.1.30.0200.04714.20
5.1.20.0200.03014.20
5.1.10.0200.04014.20
5.1.00.0170.03014.20
5.0.50.0100.03014.20
5.0.40.0030.02314.20
5.0.30.0100.03714.20
5.0.20.0070.02014.20
5.0.10.0100.02714.20
5.0.00.0070.03314.20
4.4.90.0130.03014.20
4.4.80.0100.02314.20
4.4.70.0030.02314.20
4.4.60.0130.01714.20
4.4.50.0130.03314.20
4.4.40.0130.03714.20
4.4.30.0070.01714.20
4.4.20.0030.02014.20
4.4.10.0070.02014.20
4.4.00.0100.02314.20
4.3.110.0130.01014.20
4.3.100.0100.01314.20
4.3.90.0030.02014.20
4.3.80.0070.02714.20
4.3.70.0130.01714.20
4.3.60.0100.03014.20
4.3.50.0070.01714.20
4.3.40.0030.03314.20
4.3.30.0070.03714.20
4.3.20.0070.01314.20
4.3.10.0030.02014.20
4.3.00.0070.02014.20

preferences:
49.6 ms | 401 KiB | 5 Q