3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Call the Pardot API and get the raw XML response back * * @param string $url the full Pardot API URL to call, e.g. "https://pi.pardot.com/api/prospect/version/3/do/query" * @param array $data the data to send to the API - make sure to include your api_key and user_key for authentication * @param string $method GET", "POST", "DELETE" * @return string the raw XML response from the Pardot API * @throws Exception if we were unable to contact the Pardot API or something went wrong */ function callPardotApi($url, $data, $method = 'GET') { // build out the full url, with the query string attached. $queryString = http_build_query($data, null, '&'); if (strpos($url, '?') !== false) { $url = $url . '&' . $queryString; } else { $url = $url . '?' . $queryString; } $curl_handle = curl_init($url); // wait 5 seconds to connect to the Pardot API, and 30 // total seconds for everything to complete curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($curl_handle, CURLOPT_TIMEOUT, 30); // https only, please! curl_setopt($curl_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); // ALWAYS verify SSL - this should NEVER be changed. 2 = strict verify curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 2); // return the result from the server as the return value of curl_exec instead of echoing it curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); if (strcasecmp($method, 'POST') === 0) { curl_setopt($curl_handle, CURLOPT_POST, true); } elseif (strcasecmp($method, 'GET') !== 0) { // perhaps a DELETE? curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, strtoupper($method)); } $pardotApiResponse = curl_exec($curl_handle); if ($pardotApiResponse === false) { // failure - a timeout or other problem. depending on how you want to handle failures, // you may want to modify this code. Some folks might throw an exception here. Some might // log the error. May you want to return a value that signifies an error. The choice is yours! // let's see what went wrong -- first look at curl $humanReadableError = curl_error($curl_handle); // you can also get the HTTP response code $httpResponseCode = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE); // make sure to close your handle before you bug out! curl_close($curl_handle); throw new Exception("Unable to successfully complete Pardot API call to $url -- curl error: \"". "$humanReadableError\", HTTP response code was: $httpResponseCode"); } // make sure to close your handle before you bug out! curl_close($curl_handle); return $pardotApiResponse; } //this will log in and print your API Key (good for 1 hour) to the console $rz_key = callPardotApi('https://pi.pardot.com/api/login/version/3', array( 'email' => 'myemail@email.com', 'password' => 'password', 'user_key' => '032222222222222b75a192daba28d' ) ); $number_url = 'https://pi.pardot.com/api/prospect/version/3/do/query'; $number_url .= '?user_key=032222222222222b75a192daba28d'; $number_url .= '&api_key='; $number_url .= $rz_key; $number_url .= '&list_id=97676'; $number_url = preg_replace('/\s+/', '', $number_url); echo $number_url;

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.0040.01118.55
8.3.50.0120.00921.99
8.3.40.0070.00718.75
8.3.30.0090.00618.86
8.3.20.0090.00018.69
8.3.10.0050.00319.26
8.3.00.0030.00523.66
8.2.180.0130.00716.88
8.2.170.0140.00722.96
8.2.160.0100.00320.58
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00019.77
8.2.110.0030.00721.00
8.2.100.0090.00317.91
8.2.90.0040.00418.28
8.2.80.0050.00317.97
8.2.70.0030.00518.04
8.2.60.0030.00618.04
8.2.50.0040.00418.07
8.2.40.0070.00418.24
8.2.30.0050.00319.75
8.2.20.0040.00417.69
8.2.10.0000.00817.69
8.2.00.0040.00417.82
8.1.280.0060.00925.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00620.73
8.1.230.0060.00620.96
8.1.220.0050.00317.76
8.1.210.0040.00418.95
8.1.200.0040.00417.35
8.1.190.0080.00019.19
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0040.00418.95
8.1.150.0040.00818.68
8.1.140.0060.00317.48
8.1.130.0080.00017.86
8.1.120.0000.01017.40
8.1.110.0000.00817.44
8.1.100.0050.00217.48
8.1.90.0000.00817.46
8.1.80.0040.00417.45
8.1.70.0000.00717.39
8.1.60.0040.00417.46
8.1.50.0040.00417.42
8.1.40.0000.00917.55
8.1.30.0050.00317.65
8.1.20.0030.00617.66
8.1.10.0060.00317.63
8.1.00.0040.00417.58
8.0.300.0040.00420.04
8.0.290.0000.00716.75
8.0.280.0000.00718.39
8.0.270.0050.00317.27
8.0.260.0000.00616.82
8.0.250.0060.00316.96
8.0.240.0060.00317.07
8.0.230.0030.00317.05
8.0.220.0030.00317.04
8.0.210.0030.00317.00
8.0.200.0040.00316.93
8.0.190.0070.00016.96
8.0.180.0050.00217.03
8.0.170.0070.00316.99
8.0.160.0000.00716.98
8.0.150.0000.00717.01
8.0.140.0030.00316.97
8.0.130.0050.00013.38
8.0.120.0000.00716.84
8.0.110.0000.00716.78
8.0.100.0090.00017.02
8.0.90.0040.00416.86
8.0.80.0100.01016.98
8.0.70.0040.00416.98
8.0.60.0040.00416.99
8.0.50.0040.00416.88
8.0.30.0180.00117.19
8.0.20.0130.00917.40
8.0.10.0000.00716.99
8.0.00.0100.00716.68
7.4.330.0000.00614.65
7.4.320.0040.00416.61
7.4.300.0030.00316.63
7.4.290.0000.00716.47
7.4.280.0050.00216.39
7.4.270.0070.00016.73
7.4.260.0030.00313.29
7.4.250.0020.00516.52
7.4.240.0000.00716.56
7.4.230.0070.00016.49
7.4.220.0100.01316.50
7.4.210.0070.01016.64
7.4.200.0040.00416.62
7.4.190.0050.00216.71
7.4.160.0080.01316.66
7.4.150.0140.00317.40
7.4.140.0070.01017.86
7.4.130.0080.01016.62
7.4.120.0110.00716.47
7.4.110.0030.01416.61
7.4.100.0090.01316.59
7.4.90.0110.00716.56
7.4.80.0110.01119.39
7.4.70.0120.00916.60
7.4.60.0170.00016.56
7.4.50.0040.00416.73
7.4.40.0060.01022.52
7.4.30.0080.00816.47
7.4.00.0070.01014.92
7.3.330.0000.00513.41
7.3.320.0070.00013.41
7.3.310.0040.00316.46
7.3.300.0060.00016.46
7.3.290.0000.01516.43
7.3.280.0080.00816.41
7.3.270.0040.02117.40
7.3.260.0130.00418.24
7.3.250.0140.00316.48
7.3.240.0100.00716.52
7.3.230.0030.01316.49
7.3.210.0090.00916.58
7.3.200.0150.00619.39
7.3.190.0060.00916.63
7.3.180.0060.00916.40
7.3.170.0120.00916.57
7.3.160.0040.01216.49
7.3.120.0090.00614.87
7.3.10.0100.00716.69
7.3.00.0100.01016.74
7.2.330.0000.01716.55
7.2.320.0140.00316.69
7.2.310.0100.01416.81
7.2.300.0100.01316.70
7.2.290.0190.00316.67
7.2.130.0130.00616.63
7.2.120.0040.01216.76
7.2.110.0130.00317.02
7.2.100.0040.00816.71
7.2.90.0060.01216.80
7.2.80.0030.01016.64
7.2.70.0030.01316.92
7.2.60.0050.00916.72
7.2.50.0080.00817.00
7.2.40.0070.01016.71
7.2.30.0060.00616.96
7.2.20.0120.00316.66
7.2.10.0030.01117.00
7.2.00.0060.00818.25
7.1.250.0070.00715.82
7.1.200.0040.00815.95
7.1.100.0000.01217.89
7.1.70.0060.00616.93
7.1.60.0030.02019.40
7.1.50.0100.01016.97
7.1.00.0070.07322.32
7.0.200.0040.00416.84
7.0.140.0030.07322.02
7.0.90.0130.05720.00
7.0.80.0130.06719.94
7.0.70.0500.03720.04
7.0.60.0270.04319.82
7.0.50.0030.04320.34
7.0.40.0030.08320.10
7.0.30.0030.08320.19
7.0.20.0000.04020.11
7.0.10.0130.04719.99
7.0.00.0030.07320.05
5.6.280.0000.07320.84
5.6.230.0130.03720.65
5.6.220.0070.06020.60
5.6.210.0100.03720.59
5.6.200.0170.06321.07
5.6.190.0130.08320.98
5.6.180.0030.03721.07
5.6.170.0030.07021.14
5.6.160.0030.03721.19
5.6.150.0030.04321.04
5.6.140.0000.09021.07
5.6.130.0070.04721.05
5.6.120.0070.04021.04
5.6.110.0100.04721.01
5.6.100.0100.07320.97
5.6.90.0070.08321.08
5.6.80.0100.03720.45
5.6.70.0100.06320.42
5.6.60.0130.07720.36
5.6.50.0030.08020.58
5.6.40.0070.08020.41
5.6.30.0130.08320.46
5.6.20.0130.05720.54
5.6.10.0070.07020.51
5.6.00.0070.04320.44
5.5.370.0030.04720.44
5.5.360.0200.07020.40
5.5.350.0030.07020.50
5.5.340.0170.03320.95
5.5.330.0030.04320.91
5.5.320.0030.03720.94
5.5.310.0070.05320.85
5.5.300.0070.08720.85
5.5.290.0030.05020.79
5.5.280.0130.08020.89
5.5.270.0000.06320.87
5.5.260.0000.05320.88
5.5.250.0070.08320.76
5.5.240.0030.05320.29
5.5.230.0070.07720.29
5.5.220.0070.05020.25
5.5.210.0030.05320.27
5.5.200.0030.05020.26
5.5.190.0070.07020.30
5.5.180.0030.06320.26
5.5.160.0100.06320.22
5.5.150.0100.06720.16
5.5.140.0000.06320.26
5.5.130.0100.06320.20
5.5.120.0030.05720.23
5.5.110.0030.04320.23
5.5.100.0030.04020.12
5.5.90.0070.07320.08
5.5.80.0030.04720.13
5.5.70.0070.04020.11
5.5.60.0000.04720.17
5.5.50.0170.07320.16
5.5.40.0030.07720.14
5.5.30.0100.05720.17
5.5.20.0030.04020.17
5.5.10.0030.04320.08
5.5.00.0030.07020.04
5.4.450.0030.04319.17
5.4.440.0000.04319.32
5.4.430.0070.03719.55
5.4.420.0070.07319.41
5.4.410.0000.04319.43
5.4.400.0030.08019.01
5.4.390.0000.06019.05
5.4.380.0230.06019.04
5.4.370.0200.06719.09
5.4.360.0170.06319.09
5.4.350.0070.08019.15
5.4.340.0000.05719.16
5.4.320.0070.07719.14
5.4.310.0130.06719.09
5.4.300.0070.07319.12
5.4.290.0100.07319.18
5.4.280.0100.07719.12
5.4.270.0130.07018.90
5.4.260.0000.04319.03
5.4.250.0030.07719.04
5.4.240.0030.07319.15
5.4.230.0000.08019.02
5.4.220.0070.03719.12
5.4.210.0100.07019.12
5.4.200.0030.04019.18
5.4.190.0070.05319.07
5.4.180.0000.04019.11
5.4.170.0100.07319.11
5.4.160.0030.06719.19
5.4.150.0100.05019.16
5.4.140.0130.07016.42
5.4.130.0030.07016.40
5.4.120.0100.06716.42
5.4.110.0070.05316.36
5.4.100.0030.07716.51
5.4.90.0070.07716.49
5.4.80.0130.06316.32
5.4.70.0070.07016.35
5.4.60.0070.07716.34
5.4.50.0070.07316.48
5.4.40.0070.04316.54
5.4.30.0130.03316.43
5.4.20.0070.04016.44
5.4.10.0070.03316.36
5.4.00.0070.03715.86
5.3.290.0100.03714.79
5.3.280.0170.03014.59
5.3.270.0070.08014.59
5.3.260.0100.07714.74
5.3.250.0070.06314.65
5.3.240.0130.07014.61
5.3.230.0100.07714.71
5.3.220.0030.07714.64
5.3.210.0100.06014.59
5.3.200.0000.04314.59
5.3.190.0170.06714.59
5.3.180.0070.07714.59
5.3.170.0070.07314.59
5.3.160.0030.08314.67
5.3.150.0030.08014.64
5.3.140.0070.05014.70
5.3.130.0030.06314.59
5.3.120.0130.06314.59
5.3.110.0030.04714.59
5.3.100.0030.05014.59
5.3.90.0100.03014.59
5.3.80.0070.04014.59
5.3.70.0070.03314.59
5.3.60.0000.04314.59
5.3.50.0000.04014.59
5.3.40.0030.03714.59
5.3.30.0070.03314.59
5.3.20.0000.03714.59
5.3.10.0000.03314.59
5.3.00.0000.04014.59
5.2.170.0000.03014.59
5.2.160.0070.02314.59
5.2.150.0000.03714.59
5.2.140.0000.03314.59
5.2.130.0100.02714.59
5.2.120.0030.03014.59
5.2.110.0030.02714.59
5.2.100.0030.03014.59
5.2.90.0030.04014.59
5.2.80.0100.04314.59
5.2.70.0000.03014.59
5.2.60.0170.02714.59
5.2.50.0030.03014.59
5.2.40.0100.05314.59
5.2.30.0070.02714.59
5.2.20.0030.02714.59
5.2.10.0030.03714.59
5.2.00.0030.06014.59
5.1.60.0070.03714.59
5.1.50.0070.02014.59
5.1.40.0100.02314.59
5.1.30.0070.02714.59
5.1.20.0030.02314.59
5.1.10.0000.02714.59
5.1.00.0030.02314.59
5.0.50.0000.02314.59
5.0.40.0070.02314.59
5.0.30.0000.03014.59
5.0.20.0000.03314.59
5.0.10.0000.02014.59
5.0.00.0030.03014.59
4.4.90.0000.01714.59
4.4.80.0000.01714.59
4.4.70.0000.01714.59
4.4.60.0030.01314.59
4.4.50.0000.03314.59
4.4.40.0000.02314.59
4.4.30.0070.03014.59
4.4.20.0030.01314.59
4.4.10.0030.01314.59
4.4.00.0000.02314.59
4.3.110.0000.01714.59
4.3.100.0030.01314.59
4.3.90.0000.01314.59
4.3.80.0000.02314.59
4.3.70.0030.01314.59
4.3.60.0000.01314.59
4.3.50.0000.01314.59
4.3.40.0000.02314.59
4.3.30.0000.01714.59
4.3.20.0000.01714.59
4.3.10.0030.01314.59
4.3.00.0000.01314.59

preferences:
40.86 ms | 401 KiB | 5 Q