3v4l.org

run code in 300+ PHP versions simultaneously
<? // Below is encoded script to prevent accidentaly editing. This script is virus free and no malicious code, you can check it with virus scan. // You might ask me to get decoded version of this script, or you can decoded it your self using base64 decoded tools. // If you're not a geek enough, trust me, just go banked with this tools without worried. // C#7 http://stoodio2.com ?> <? function amazonEncode($text) { $encodedText = ""; $j = strlen($text); for($i=0;$i<$j;$i++) { $c = substr($text,$i,1); if (!preg_match("/[A-Za-z0-9\-_.~]/",$c)) { $encodedText .= sprintf("%%%02X",ord($c)); } else { $encodedText .= $c; } } return $encodedText; } function amazonSign($url,$secretAccessKey) { // 0. Append Timestamp parameter $url .= "&Timestamp=".gmdate("Y-m-d\TH:i:s\Z"); // 1a. Sort the UTF-8 query string components by parameter name $urlParts = parse_url($url); parse_str($urlParts["query"],$queryVars); ksort($queryVars); // 1b. URL encode the parameter name and values $encodedVars = array(); foreach($queryVars as $key => $value) { $encodedVars[amazonEncode($key)] = amazonEncode($value); } // 1c. 1d. Reconstruct encoded query $encodedQueryVars = array(); foreach($encodedVars as $key => $value) { $encodedQueryVars[] = $key."=".$value; } $encodedQuery = implode("&",$encodedQueryVars); // 2. Create the string to sign $stringToSign = "GET"; $stringToSign .= "\n".strtolower($urlParts["host"]); $stringToSign .= "\n".$urlParts["path"]; $stringToSign .= "\n".$encodedQuery; // 3. Calculate an RFC 2104-compliant HMAC with the string you just created, // your Secret Access Key as the key, and SHA256 as the hash algorithm. if (function_exists("hash_hmac")) { $hmac = hash_hmac("sha256",$stringToSign,$secretAccessKey,TRUE); } elseif(function_exists("mhash")) { $hmac = mhash(MHASH_SHA256,$stringToSign,$secretAccessKey); } else { die("No hash function available!"); } // 4. Convert the resulting value to base64 $hmacBase64 = base64_encode($hmac); // 5. Use the resulting value as the value of the Signature request parameter // (URL encoded as per step 1b) $url .= "&Signature=".amazonEncode($hmacBase64); return $url; }?> <? if ($opr=='Lookup') { $url = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"; $url .= "&Version=2011-08-01"; $url .= "&Operation=ItemLookup"; $url .= "&AWSAccessKeyId=".$amazonAWSAccessKeyId; $url .= "&AssociateTag=".$amazonAssociateTag; $url .= "&ResponseGroup=Large"; $url .= "&IncludeReviewsSummary=True"; $url .= "&ItemId=".$asin; $url = amazonSign($url,$amazonSecretAccessKey); $xml = simplexml_load_file($url); $item = $xml->Items->Item; }?> <? $item_asin = $item[0]->ASIN; $item_url = $item[0]->DetailPageURL; $item_image1 = $item[0]->MediumImage->URL; $item_image2 = $item[0]->LargeImage->URL; $item_title = $item[0]->ItemAttributes->Title; $item_price = $item[0]->OfferSummary->LowestNewPrice->FormattedPrice; if ($item_price=='') { $item_price = $item[0]->ItemAttributes->ListPrice->FormattedPrice; } $item_list = $item[0]->ItemAttributes->ListPrice->FormattedPrice; if ($item_list=='') { $item_list = 'only '; } else { $item_list = '<font color="red"><del>'.$item_list.'</del></font>'; } $item_save = $item[0]->Offers->Offer->OfferListing->AmountSaved->FormattedPrice; $item_model = $item[0]->ItemAttributes->Model; $item_brand = $item[0]->ItemAttributes->Brand; $item_binding = $item[0]->ItemAttributes->Binding; $item_color = $item[0]->ItemAttributes->Color; $item_unit = $item[0]->OfferSummary->TotalNew; $item_warranty= $item[0]->ItemAttributes->Warranty; $item_height = $item[0]->ItemAttributes->ItemDimensions->Height; $item_length = $item[0]->ItemAttributes->ItemDimensions->Length; $item_weight = $item[0]->ItemAttributes->ItemDimensions->Weight; $item_width = $item[0]->ItemAttributes->ItemDimensions->Width; if ($item_height!=0) { $item_height = $item_height/100; } else { $item_height = 0; } if ($item_length!=0) { $item_length = $item_length/100; } else { $item_length = 0; } if ($item_weight!=0) { $item_weight = $item_weight/100; } else { $item_weight = 0; } if ($item_width!=0) { $item_width = $item_width/100; } else { $item_width = 0; } //featured $item_feat = $item[0]->ItemAttributes->Feature[0]; $item_feat1 = $item[0]->ItemAttributes->Feature[1]; $item_feat2 = $item[0]->ItemAttributes->Feature[2]; $item_feat3 = $item[0]->ItemAttributes->Feature[3]; $item_feat4 = $item[0]->ItemAttributes->Feature[4]; $item_avail = $item[0]->Offers->Offer->OfferListing->Availability; $item_cust = $item[0]->CustomerReviews->IFrameURL; $item_edit = $item[0]->EditorialReviews->EditorialReview->Content; $item_edit1 = $item[0]->EditorialReviews->EditorialReview[1]->Content; $item_sim = $item[0]->SimilarProducts->SimilarProduct[0]->ASIN; $item_sim1 = $item[0]->SimilarProducts->SimilarProduct[1]->ASIN;?> <? $judul = 'Only '.$item_price.' from '.$item_brand; if ($item_color='') { $konten = $item_brand. ' offer the best <strong> '.$item_title.'</strong> with '.strtolower($item_color).' color or pattern options.'; } else { $konten = $item_brand. ' offer the best <strong> '.$item_title.'</strong>.'; } if ($item_unit>1) { $konten1 = 'This awesome product currently <font color="green"><strong>'.$item_unit.'</strong></font> unit available, you can buy it now for '.$item_list.' <strong>'.$item_price.'</strong> and '.strtolower($item_avail); } else { $konten1 = 'This awesome product currently in stocks, you can get this '.$item_binding.' now for '.$item_list.' <strong>'.$item_price.'</strong>.'; } $gambar = $item_image2; if ($item_warranty!='') { $garansi = $item_brand.' give '.strtolower($item_warranty); } else { $garansi = 'Currently no specific warranty for this products'; } $feat = $item_feat.'<br>'.$item_feat1.'<br>'.$item_feat2.'<br>'.$item_feat3.'<br>'.$item_feat4; if ($item_edit!='') { $keterangan = substr(strip_tags($item_edit), 0, 600); } else { $keterangan = 'Currently no descriptions for this product and will be added soon.'; } $review = $item_cust; $beli = $item_url; $harga = $item_price.' Buy NOW!'; ?> <? // similiar products if ($item_sim) { $url = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService"; $url .= "&Version=2011-08-01"; $url .= "&Operation=ItemLookup"; $url .= "&AWSAccessKeyId=".$amazonAWSAccessKeyId; $url .= "&AssociateTag=".$amazonAssociateTag; $url .= "&ResponseGroup=Medium"; $url .= "&ItemId=".$item_sim.','.$item_sim1; $url = amazonSign($url,$amazonSecretAccessKey); $xml = simplexml_load_file($url); $item = $xml->Items->Item; }?> <? // similiar detail #1 $sim_asin = $item[0]->ASIN; $sim_gambar = $item[0]->LargeImage->URL; $sim_harga = $item[0]->OfferSummary->LowestNewPrice->FormattedPrice; if ($sim_harga =='') { $sim_harga = $item[0]->ItemAttributes->ListPrice->FormattedPrice; } $sim_judul = 'Only '.$sim_harga.' '.$item[0]->ItemAttributes->Title; // similiar detail #2 $sim_asin1 = $item[1]->ASIN; $sim_gambar1 = $item[1]->LargeImage->URL; $sim_harga1 = $item[1]->OfferSummary->LowestNewPrice->FormattedPrice; if ($sim_harga1 =='') { $sim_harga1 = $item[1]->ItemAttributes->ListPrice->FormattedPrice; } $sim_judul1 = 'Only '.$sim_harga1.' '.$item[1]->ItemAttributes->Title;?> <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?>

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.0110.01118.30
8.3.50.0080.01021.99
8.3.40.0140.00718.84
8.3.30.0140.00019.15
8.3.20.0050.00220.33
8.3.10.0070.00023.65
8.3.00.0040.00419.02
8.2.180.0120.00918.04
8.2.170.0090.00622.96
8.2.160.0100.00321.13
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.64
8.2.110.0030.00720.91
8.2.100.0080.00417.78
8.2.90.0040.00417.78
8.2.80.0080.00018.89
8.2.70.0030.00617.63
8.2.60.0000.00817.63
8.2.50.0040.00417.55
8.2.40.0000.00819.36
8.2.30.0030.00519.15
8.2.20.0050.00317.70
8.2.10.0070.00017.96
8.2.00.0040.00417.46
8.1.280.0070.01025.92
8.1.270.0060.00318.53
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.01
8.1.230.0080.00320.88
8.1.220.0050.00217.74
8.1.210.0050.00318.77
8.1.200.0110.00017.22
8.1.190.0070.00317.10
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00418.70
8.1.150.0000.00718.83
8.1.140.0050.00217.41
8.1.130.0070.00017.89
8.1.120.0000.00817.32
8.1.110.0000.00717.35
8.1.100.0040.00417.23
8.1.90.0040.00417.25
8.1.80.0000.00817.36
8.1.70.0000.00717.36
8.1.60.0000.00817.38
8.1.50.0040.00417.43
8.1.40.0000.00817.47
8.1.30.0000.00917.54
8.1.20.0000.00917.50
8.1.10.0050.00317.38
8.1.00.0040.00417.27
8.0.300.0070.00019.80
8.0.290.0000.00916.63
8.0.280.0030.00318.34
8.0.270.0000.00717.14
8.0.260.0000.00617.23
8.0.250.0000.00716.82
8.0.240.0030.00316.73
8.0.230.0080.00016.84
8.0.220.0000.00716.79
8.0.210.0030.00316.76
8.0.200.0060.00016.74
8.0.190.0040.00416.89
8.0.180.0000.00716.82
8.0.170.0000.00816.72
8.0.160.0000.00816.86
8.0.150.0070.00016.63
8.0.140.0080.00016.76
8.0.130.0030.00313.56
8.0.120.0070.00316.70
8.0.110.0050.00216.84
8.0.100.0070.00016.66
8.0.90.0000.00816.80
8.0.80.0070.01016.80
8.0.70.0070.00016.61
8.0.60.0000.00716.61
8.0.50.0020.00516.74
8.0.30.0040.01416.98
8.0.20.0070.01217.40
8.0.10.0040.00416.79
8.0.00.0110.01116.67
7.4.330.0000.00615.03
7.4.320.0060.00016.43
7.4.300.0000.00716.43
7.4.290.0000.00716.42
7.4.280.0050.00316.48
7.4.270.0000.00716.56
7.4.260.0000.00716.32
7.4.250.0040.00416.46
7.4.240.0030.00516.42
7.4.230.0030.00316.48
7.4.220.0030.01616.39
7.4.210.0100.01116.51
7.4.200.0040.00416.41
7.4.160.0060.00916.32
7.4.150.0120.00617.40
7.4.140.0130.00817.86
7.4.130.0110.00616.30
7.4.120.0140.00616.44
7.4.110.0060.01216.48
7.4.100.0110.00616.32
7.4.90.0130.00316.25
7.4.80.0080.00919.39
7.4.70.0090.00616.27
7.4.60.0070.01016.38
7.4.50.0040.00416.34
7.4.40.0070.01016.37
7.4.30.0030.01316.50
7.4.00.0030.01415.10
7.3.330.0000.00513.52
7.3.320.0030.00313.52
7.3.310.0030.00316.27
7.3.300.0000.00616.11
7.3.290.0080.00516.18
7.3.280.0080.00916.18
7.3.270.0110.00717.40
7.3.260.0140.00416.37
7.3.250.0110.01016.32
7.3.240.0070.01016.25
7.3.230.0100.00616.40
7.3.210.0080.00816.36
7.3.200.0120.00619.39
7.3.190.0150.00016.20
7.3.180.0140.00316.31
7.3.170.0170.00316.38
7.3.160.0110.00416.40
7.3.10.0170.00316.59
7.3.00.0140.00716.72
7.2.330.0120.01316.31
7.2.320.0150.00916.52
7.2.310.0060.01216.51
7.2.300.0090.00916.66
7.2.290.0080.00816.42
7.2.130.0140.01216.96
7.2.120.0070.01716.86
7.2.110.0230.00016.88
7.2.100.0200.00416.91
7.2.90.0240.00616.57
7.2.80.0170.01016.83
7.2.70.0140.00816.95
7.2.60.0090.01016.54
7.2.50.0120.01216.83
7.2.40.0150.00717.02
7.2.30.0080.01216.80
7.2.20.0170.00916.76
7.2.10.0160.00916.77
7.2.00.0100.00918.16
7.1.250.0160.00415.36
7.1.240.0110.01115.73
7.1.230.0070.01015.88
7.1.220.0100.01415.78
7.1.210.0080.01615.87
7.1.200.0110.00915.74
7.1.190.0110.01415.84
7.1.180.0150.00915.85
7.1.170.0060.01215.62
7.1.160.0140.01015.95
7.1.150.0110.01015.84
7.1.140.0170.00315.69
7.1.130.0080.00815.77
7.1.120.0150.00815.91
7.1.110.0150.00815.95
7.1.100.0070.01117.01
7.1.90.0140.01115.61
7.1.80.0110.01115.76
7.1.70.0060.01116.28
7.1.60.0080.01417.57
7.1.50.0080.01216.34
7.1.40.0040.00815.66
7.1.30.0150.00715.66
7.1.20.0160.00415.78
7.1.10.0140.00415.88
7.1.00.0070.04319.14
7.0.330.0190.00315.40
7.0.320.0090.00915.45
7.0.310.0070.00715.34
7.0.300.0120.00315.34
7.0.290.0070.00715.12
7.0.280.0070.01014.91
7.0.270.0060.01015.50
7.0.260.0080.00415.31
7.0.250.0120.00615.65
7.0.240.0080.00815.42
7.0.230.0060.01015.04
7.0.220.0070.01015.23
7.0.210.0070.01315.37
7.0.200.0070.00516.01
7.0.190.0100.00715.16
7.0.180.0090.00615.19
7.0.170.0130.00714.91
7.0.160.0140.00315.30
7.0.150.0030.01015.27
7.0.140.0040.02618.56
7.0.130.0140.00715.18
7.0.120.0070.00715.20
7.0.110.0170.00315.38
7.0.100.0070.04817.84
7.0.90.0060.04517.60
7.0.80.0080.04317.61
7.0.70.0180.04117.69
7.0.60.0130.04417.73
7.0.50.0070.04718.04
7.0.40.0040.03816.78
7.0.30.0050.04116.77
7.0.20.0120.03316.59
7.0.10.0030.04516.76
7.0.00.0030.04916.64
5.6.380.0120.00414.50
5.6.370.0090.00914.48
5.6.360.0090.00314.05
5.6.350.0130.00314.57
5.6.340.0090.00614.68
5.6.330.0090.00614.57
5.6.320.0110.00314.34
5.6.310.0040.01114.39
5.6.300.0030.00914.29
5.6.290.0040.01414.28
5.6.280.0110.03617.71
5.6.270.0040.00814.01
5.6.260.0060.00614.18
5.6.250.0070.03017.46
5.6.240.0050.04817.56
5.6.230.0050.04717.45
5.6.220.0100.02617.61
5.6.210.0050.04617.47
5.6.200.0060.04117.59
5.6.190.0090.04517.66
5.6.180.0080.04117.89
5.6.170.0080.04517.78
5.6.160.0070.02917.83
5.6.150.0040.04917.68
5.6.140.0130.02517.87
5.6.130.0080.03617.72
5.6.120.0160.03717.89
5.6.110.0060.04017.72
5.6.100.0130.03617.85
5.6.90.0050.04517.78
5.6.80.0070.04217.18
5.6.70.0090.02217.28
5.6.60.0080.03317.33
5.6.50.0050.02617.29
5.6.40.0080.03817.32
5.6.30.0070.03417.45
5.6.20.0070.03917.35
5.6.10.0070.02617.28
5.6.00.0080.03917.34
5.5.380.0120.02815.90
5.5.370.0110.02615.83
5.5.360.0070.02815.91
5.5.350.0100.02815.84
5.5.340.0120.02716.14
5.5.330.0120.03016.10
5.5.320.0070.02716.22
5.5.310.0080.02916.08
5.5.300.0080.04416.06
5.5.290.0080.04316.14
5.5.280.0110.03815.77
5.5.270.0070.04215.78
5.5.260.0050.02816.04
5.5.250.0070.04715.94
5.5.240.0120.03715.64
5.5.230.0060.03115.79
5.5.220.0100.03315.75
5.5.210.0100.03515.64
5.5.200.0080.03215.67
5.5.190.0050.03815.45
5.5.180.0100.03315.61
5.5.170.0050.00510.77
5.5.160.0070.03915.47
5.5.150.0050.03815.60
5.5.140.0070.04515.67
5.5.130.0110.03815.58
5.5.120.0110.03515.68
5.5.110.0050.02715.68
5.5.100.0010.02915.44
5.5.90.0060.02615.53
5.5.80.0090.04015.53
5.5.70.0040.04515.55
5.5.60.0070.04515.46
5.5.50.0050.03515.54
5.5.40.0090.03315.57
5.5.30.0050.02515.58
5.5.20.0090.03715.77
5.5.10.0080.03215.27
5.5.00.0030.04515.52
5.4.450.0070.04215.31
5.4.440.0070.03915.34
5.4.430.0030.04115.16
5.4.420.0070.04115.14
5.4.410.0100.03815.05
5.4.400.0000.02815.10
5.4.390.0070.04015.07
5.4.380.0090.03514.92
5.4.370.0070.01815.02
5.4.360.0080.03314.97
5.4.350.0080.03515.11
5.4.340.0080.02214.94
5.4.330.0090.00011.16
5.4.320.0090.03315.13
5.4.310.0110.03215.02
5.4.300.0080.03815.14
5.4.290.0100.04015.00
5.4.280.0050.04214.89
5.4.270.0060.04115.15
5.4.260.0080.02815.01
5.4.250.0060.04214.78
5.4.240.0020.02915.03
5.4.230.0050.04314.98
5.4.220.0080.03214.76
5.4.210.0050.04015.06
5.4.200.0070.03314.88
5.4.190.0080.02315.01
5.4.180.0050.04315.05
5.4.170.0050.02815.04
5.4.160.0040.02214.98
5.4.150.0100.04014.89
5.4.140.0030.04213.62
5.4.130.0080.03913.58
5.4.120.0100.02113.70
5.4.110.0120.03613.50
5.4.100.0140.02813.72
5.4.90.0100.03413.53
5.4.80.0050.02513.60
5.4.70.0060.04113.56
5.4.60.0100.01813.53
5.4.50.0020.03813.63
5.4.40.0030.04113.51
5.4.30.0050.04013.56
5.4.20.0070.01713.62
5.4.10.0020.02413.66
5.4.00.0030.03613.49

preferences:
58.6 ms | 401 KiB | 5 Q