3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* ======== This file is being used to simulate an E-commerce sale in Google Analytics based on the users' original cookies. This URL needs to be loaded by the Affiliate Netwerk. Be careful while testing: deleting E-Commerce sales from Google Analytics can only be achieved by adding the same transaction with negative values (see http://support.google.com/googleanalytics/bin/answer.py?hl=en-GB&answer=72290). ========= */ $username="fashion_test"; $password="0509143335"; $database="fashion_test"; // Settings //$var_utmhn='fashion-experts.com'; //enter your domain //$utmac = 'UA-44436624-1'; // Analytics account $var_utmhn='best-fashion-deals.com'; //enter your domain $utmac = 'UA-55018676-1'; // Analytics account $testing = "0"; // 1 = test-mode on (nothing will be send to Google Analytics) $email = "gdalia.erez@gmail.com"; // To send an email while testing //mysql_connect(localhost,$username,$password); //@mysql_select_db($database) or die( "Unable to select database"); // Get required variables from the URL $subid = "3833313162366334343065623666373131393539383331373963326163323161"; $orderid = "9"; // Order ID - unique ID for the transaction $total = "9"; //Total and unit price - affiliate fee for the sale $sku = "9"; // product code if ($sku == "") {$sku = "1";} // in case you didn't provide any product code It'll just take "1".. // Get some optional variables from the URL $storename = $_GET["storename"]; // Affiliation or store name - name of the business your promoting (e.g. "WP4FB") $tax = $_GET["tax"]; $shipping = $_GET["shipping"]; $city = $_GET["city"]; $region = $_GET["region"]; $country = $_GET["country"]; $orderid = $_GET["orderid"]; $productname = $_GET["productname"]; $category = $_GET["category"]; $utmipc = $sku; // Product code / SKU $utmipn = $productname; // Product name $utmipr = $total; // Unit price $utmiqt = '1'; // Unit quantity if ($tax != "") {$utmttx = $tax;} else {$utmttx = '0.0';} // Tax if ($shipping != "") {$utmtsp = $shipping;} else {$utmtsp = '0.0';} // Shipping cost if ($city != "") {$utmtci = $city;} else {$utmtci = 'na';} // Billing city if ($region != "") {$utmtrg = $region;} else {$utmtrg = 'na';} // Billing region if ($country != "") {$utmtco = $country;} else {$utmtco = 'na';} // Billing country if ($tax != "") {$utmttx = $tax;} else {$utmttx = '0.0';} $utmp = 'leadtracking.php'; //Page request of the current page (required, no need to change this) $utmiva = ''; $var_utmn=rand(1000000000,9999999999);//random request number to prevent caching $var_utmn2=rand(1000000000,9999999999);//random request number to prevent caching $var_utmn3=rand(1000000000,9999999999);//random request number to prevent caching $utmhid=rand(1000000000,9999999999);//random request number to prevent caching // Looks up the original cookie in the DB //$query= "SELECT * FROM clicks WHERE subid='$subid'"; //$result=mysql_query($query); /*if (mysql_numrows($result) == 1) { $utma=mysql_result($result,$i,"utma"); $utmz=mysql_result($result,$i,"utmz"); $utmv=mysql_result($result,$i,"utmv"); $utmx=mysql_result($result,$i,"utmx"); } else { echo "Subid not found in database."; exit(); }*/ $utma="91177353.571070991.1413196407.1413209241.1413213333.3"; $utmz="91177353.1413196407.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"; $utmv=""; $utmx=""; $utmipn = str_replace(" ","%20",$utmipn); $utma = str_replace(" ","%20",$utma); $utma = str_replace("|","%7C",$utma); $utmz = str_replace(" ","%20",$utmz); $utmz = str_replace("|","%7C",$utmz); $utmv = str_replace(" ","%20",$utmv); $utmv = str_replace("|","%7C",$utmv); $utmx = str_replace(" ","%20",$utmx); $utmx = str_replace("|","%7C",$utmx); // Simulates E-Commerce Sale $transactionUrl ='http://www.google-analytics.com/__utm.gif?utmwv=4.6.5&utmn='.$var_utmn.'&utmhn='.$var_utmhn.'&utmt=tran&utmtid='.$orderid.'&utmtst='.$storename.'&utmtto='.$utmipr.'&utmttx='.$utmttx.'&utmtsp='.$utmtsp.'&utmtci='.$utmtci.'&utmtrg='.$utmtrg.'&utmtco='.$utmtco.'&utmac='.$utmac.'&utmcc=__utma%3D'.$utma.'%3B%2B__utmz%3D'.$utmz.'%3B%2B__utmv%3D'.$utmv.'%3B%2B__utmk%3D'.$utmk.'%3B'; $itemUrl = 'http://www.google-analytics.com/__utm.gif?utmwv=4.6.5&utmn='.$var_utmn2.'&utmhn='.$var_utmhn.'&utmt=item&utmtid='.$orderid.'&utmipc='.$utmipc.'&utmipn='.$utmipn.'&utmiva='.$utmiva.'&utmipr='.$utmipr.'&utmiqt='.$utmiqt.'&utmac='.$utmac.'&utmcc=__utma%3D'.$utma.'%3B%2B__utmz%3D'.$utmz.'%3B%2B__utmv%3D'.$utmv.'%3B%2B__utmk%3D'.$utmk.'%3B'; $urchinUrl ='http://www.google-analytics.com/__utm.gif?utmwv=4.6.5&utmn='.$var_utmn3.'&utmhn='.$var_utmhn.'&utmp='.$utmp.'&utmac='.$utmac.'&utmcc=__utma%3D'.$utma.'%3B%2B__utmz%3D'.$utmz.'%3B%2B__utmv%3D'.$utmv.'%3B%2B__utmk%3D'.$utmk.'%3B'; // Send E-commerce sale to Google Analytics $testing = "0"; if ($testing == "0") { $handle = fopen ($transactionUrl, "r"); $test = fgets($handle); $handle2 = fopen ($itemUrl, "r"); $test2 = fgets($handle2); $handle3 = fopen ($urchinUrl, "r"); $test3 = fgets($handle3); fclose($handle); fclose($handle2); fclose($handle3); } else { // Show's Google Analytics URL's for testing purposes echo $transactionUrl." ".$itemUrl." ".$urchinUrl." "; // Send email $message = $transactionUrl."\n".$itemUrl."\n".$urchinUrl."\n\n Thanks for using Affiliate2Analytics.com!"; mail($email, 'Affiliate 2 Analytics test', $message); } //mysql_close();

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)
7.2.110.0190.01116.87
7.2.100.0220.00716.50
7.2.90.0250.00716.98
7.2.80.0250.00916.64
7.2.70.0400.00717.04
7.2.60.0390.01117.20
7.2.50.0400.01816.84
7.2.40.0380.00616.85
7.2.30.0300.00917.05
7.2.20.0190.01117.21
7.2.10.0370.00816.96
7.2.00.0160.00618.50
7.1.230.1110.01016.10
7.1.220.0410.01216.18
7.1.210.0190.01116.16
7.1.200.0200.00816.09
7.1.190.0310.01915.94
7.1.180.0480.00415.57
7.1.170.0330.00716.02
7.1.160.0320.00416.20
7.1.150.0290.01016.18
7.1.140.0320.00716.13
7.1.130.0140.00916.24
7.1.120.0310.00915.71
7.1.110.0320.00916.13
7.1.100.0120.01216.04
7.1.90.0110.01816.00
7.1.80.0140.01315.89
7.1.70.0100.00716.92
7.1.60.0400.00816.92
7.1.50.0110.01716.65
7.1.40.0680.01316.06
7.1.30.0280.00616.30
7.1.20.0180.01816.36
7.1.10.0180.00915.98
7.1.00.0120.04319.57
7.0.310.0200.01115.43
7.0.300.0430.00315.39
7.0.290.0290.00315.49
7.0.280.0220.00315.64
7.0.270.0170.00715.64
7.0.260.0140.01115.83
7.0.250.0170.00315.52
7.0.240.0260.01115.80
7.0.230.0270.01515.31
7.0.220.0110.01415.71
7.0.210.0160.01115.70
7.0.200.0090.01116.19
7.0.190.0250.00415.66
7.0.180.0150.00915.67
7.0.170.0550.00615.45
7.0.160.0180.01015.78
7.0.150.0400.00915.59
7.0.140.0140.04019.08
7.0.130.0150.01115.76
7.0.120.0090.03619.04
7.0.110.0100.04319.01
7.0.100.0100.04219.04
7.0.90.0070.04618.91
7.0.80.0110.04218.88
7.0.70.0160.03518.86
7.0.60.0150.03319.04
7.0.50.0100.04119.07
7.0.40.0090.04118.11
7.0.30.0120.03918.00
7.0.20.0080.04318.10
7.0.10.0120.04017.94
7.0.00.0160.03418.01
5.6.380.0100.01214.64
5.6.370.0320.00814.76
5.6.360.0340.00514.61
5.6.350.0300.00714.89
5.6.340.0150.00814.96
5.6.330.0180.01114.23
5.6.320.0100.01614.91
5.6.310.0110.01814.84
5.6.300.0150.01514.59
5.6.290.0170.01114.53
5.6.280.0120.04118.05
5.6.270.0220.00514.90
5.6.260.0120.04018.20
5.6.250.0150.03518.06
5.6.240.0140.04217.92
5.6.230.0080.04517.95
5.6.220.0100.03918.14
5.6.210.0080.04118.14
5.6.200.0100.04618.04
5.6.190.0090.04618.02
5.6.180.0120.03918.07
5.6.170.0140.03818.14
5.6.160.0080.04218.03
5.6.150.0070.04418.02
5.6.140.0110.04417.97
5.6.130.0090.04018.06
5.6.120.0040.04918.01
5.6.110.0090.04418.12
5.6.100.0130.04017.97
5.6.90.0090.04318.11
5.6.80.0140.03517.49
5.6.70.0070.04417.71
5.6.60.0100.03917.69
5.6.50.0160.03517.64
5.6.40.0070.03817.65
5.6.30.0080.04517.62
5.6.20.0170.03817.64
5.6.10.0220.04117.63
5.6.00.0220.03717.57
5.5.380.0060.04214.60
5.5.370.0090.03614.82
5.5.360.0040.04314.63
5.5.350.0120.03514.84
5.5.340.0070.04014.96
5.5.330.0070.03915.00
5.5.320.0080.03914.71
5.5.310.0070.03715.08
5.5.300.0130.03515.01
5.5.290.0120.03814.82
5.5.280.0080.04014.91
5.5.270.0090.03914.77
5.5.260.0070.04215.02
5.5.250.0080.03814.80
5.5.240.0120.03314.82
5.5.230.0040.03914.59
5.5.220.0070.03914.58
5.5.210.0060.03614.34
5.5.200.0080.03714.52
5.5.190.0120.03714.57
5.5.180.0070.04014.57
5.5.170.0370.00614.61
5.5.160.0000.04614.63
5.5.150.0130.04114.60
5.5.140.0160.03314.45
5.5.130.0110.03614.51
5.5.120.0140.03414.58
5.5.110.0070.03414.63
5.5.100.0120.03214.58
5.5.90.0180.03514.67
5.5.80.0050.03714.46
5.5.70.0130.03814.38
5.5.60.0110.03614.41
5.5.50.0140.03614.55
5.5.40.0140.02814.38
5.5.30.0120.03414.55
5.5.20.0160.03114.49
5.5.10.0120.03914.72
5.5.00.0140.03314.51
5.4.450.0070.04015.83
5.4.440.0070.04015.67
5.4.430.0050.04315.66
5.4.420.0060.03915.76
5.4.410.0100.03715.65
5.4.400.0140.03315.38
5.4.390.0080.03715.49
5.4.380.0060.03915.42
5.4.370.0110.03515.45
5.4.360.0100.03915.21
5.4.350.0070.03715.54
5.4.340.0130.03515.30
5.4.330.0130.00811.29
5.4.320.0140.03415.48
5.4.310.0120.03515.23
5.4.300.0130.03315.40
5.4.290.0150.03515.29
5.4.280.0100.03915.27
5.4.270.0140.03515.14
5.4.260.0080.04315.19
5.4.250.0160.03515.36
5.4.240.0100.03815.38
5.4.230.0130.03315.33
5.4.220.0130.03515.37
5.4.210.0150.03215.37
5.4.200.0120.02815.46
5.4.190.0170.03915.49
5.4.180.0060.03815.33
5.4.170.0130.03315.39
5.4.160.0130.03815.34
5.4.150.0120.03715.41
5.4.140.0130.03614.17
5.4.130.0130.03314.28
5.4.120.0100.03213.91
5.4.110.0040.04014.03
5.4.100.0090.02914.11
5.4.90.0060.03614.10
5.4.80.0070.03514.24
5.4.70.0070.03114.14
5.4.60.0110.03414.02
5.4.50.0100.03314.00
5.4.40.0080.03014.14
5.4.30.0030.04013.95
5.4.20.0070.03414.12
5.4.10.0020.04214.24
5.4.00.0060.03513.86
5.3.290.0100.03913.00
5.3.280.0120.03712.71
5.3.270.0100.03712.85
5.3.260.0090.04012.84
5.3.250.0100.03912.85
5.3.240.0090.03512.78
5.3.230.0050.03912.67
5.3.220.0070.03212.67
5.3.210.0050.03512.70
5.3.200.0040.03412.71
5.3.190.0120.02812.60
5.3.180.0070.03512.71
5.3.170.0050.03712.68
5.3.160.0100.03312.89
5.3.150.0050.03912.83
5.3.140.0050.03712.87
5.3.130.0130.03312.78
5.3.120.0050.04112.74
5.3.110.0050.04012.88
5.3.100.0050.03912.50
5.3.90.0110.03212.56
5.3.80.0070.03412.43
5.3.70.0080.03612.46
5.3.60.0070.03512.32
5.3.50.0060.03512.34
5.3.40.0090.03312.51
5.3.30.0050.03612.41
5.3.20.0060.03712.22
5.3.10.0080.03512.15
5.3.00.0130.03012.11
5.2.170.0080.03011.76
5.2.160.0060.03011.76
5.2.150.0040.03311.76
5.2.140.0050.03211.76
5.2.130.0040.03211.76
5.2.120.0050.03011.76
5.2.110.0080.02711.76
5.2.100.0050.03111.76
5.2.90.0090.02711.76
5.2.80.0030.03211.76
5.2.70.0050.03211.76
5.2.60.0030.03211.76
5.2.50.0070.02811.76
5.2.40.0030.02911.76
5.2.30.0080.02911.76
5.2.20.0030.03211.76
5.2.10.0030.03011.76
5.2.00.0070.02811.76
5.1.60.0050.02511.76
5.1.50.0070.02511.76
5.1.40.0040.02211.76
5.1.30.0040.02811.76
5.1.20.0030.02211.76
5.1.10.0020.02711.76
5.1.00.0060.01911.76
5.0.50.0040.01911.76
5.0.40.0080.01811.76
5.0.30.0020.02911.76
5.0.20.0040.02411.76
5.0.10.0040.02211.76
5.0.00.0060.02911.76
4.4.90.0070.01511.76
4.4.80.0020.01911.76
4.4.70.0050.01811.76
4.4.60.0030.01611.76
4.4.50.0050.01511.76
4.4.40.0050.02611.76
4.4.30.0050.01611.76
4.4.20.0000.01811.76
4.4.10.0070.01511.76
4.4.00.0030.02311.76
4.3.110.0030.01711.76
4.3.100.0030.01811.76
4.3.90.0030.01711.76
4.3.80.0040.02611.76
4.3.70.0030.01811.76
4.3.60.0010.01811.76
4.3.50.0040.01611.76
4.3.40.0030.02711.76
4.3.30.0000.02111.76
4.3.20.0040.01611.76
4.3.10.0030.01811.76
4.3.00.0050.01511.76

preferences:
38.85 ms | 401 KiB | 5 Q