3v4l.org

run code in 300+ PHP versions simultaneously
<?php class OpenCalaisHandler { private $apiKey; private $apiUrl = 'http://api.opencalais.com/enlighten/rest/'; private $contentType = 'TEXT/RAW'; private $outputFormat = 'Application/JSON'; private $relTag = 'http://www.stefan-nieuwenhuis.nl'; private $calcRel = true; //calculate relevance score? private $enableMeta = false; //GenericRelations,SocialTags private $rdfAccess = false; //save doc in Calais repository? private $allowDist = false; //can data be distributed? private $allowSearch = false; //allow data to be searched? private $extId = 'Stefan_Nieuwenhuis'; private $submitter = 'Stefan Nieuwenhuis'; private $inputString = ''; function __construct($apiKey) { $this->apiKey = $apiKey; $this->SetupConnection; } private function GetInput() { return $this->inputString; } private function SetupConnection() { $postFields = 'licenseID='.urlencode($this->apiKey); $postFields .= '&paramsXML='.urlencode($this->CreateParamXml()); $postFields .= '&content='.urlencode($this->GetInput()); $cf = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->apiUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); curl_setopt($ch, CURLOPT_POST, 1); $response = curl_exec($cf); return $response; } private function CreateParamXml() { $xml = <<<XML <c:params xmlns:c="http://s.opencalais.com/1/pred/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <c:processingDirectives c:contentType="$this->contentType" c:enableMetadataType="$this->enableMeta" c:outputFormat="$this->outputFormat" c:docRDFaccesible="$this->rdfAccess" > </c:processingDirectives> <c:userDirectives c:allowDistribution="$this->allowDist" c:allowSearch="$this->allowSearch" c:externalID="$this->extId" c:submitter="$this->submitter"> </c:userDirectives> <c:externalMetadata> </c:externalMetadata> </c:params> XML; return $xml; } } $class = new OpenCalaisHandler('kx78mmny8st4qa8q5ry5uvv9'); ?>

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.0130.00318.43
8.3.50.0080.01022.01
8.3.40.0090.00618.88
8.3.30.0170.00318.75
8.3.20.0000.00821.97
8.3.10.0080.00022.10
8.3.00.0040.00422.52
8.2.180.0090.00916.60
8.2.170.0130.00322.96
8.2.160.0110.00320.95
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00417.63
8.2.110.0130.00322.26
8.2.100.0080.00317.72
8.2.90.0050.00319.27
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0030.00617.80
8.2.50.0050.00318.07
8.2.40.0040.00417.97
8.2.30.0050.00318.12
8.2.20.0000.00817.54
8.2.10.0040.00417.63
8.2.00.0000.00717.52
8.1.280.0080.00825.92
8.1.270.0090.00023.84
8.1.260.0080.00026.35
8.1.250.0040.01128.09
8.1.240.0040.00423.79
8.1.230.0030.00719.08
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0000.00817.50
8.1.180.0000.00818.10
8.1.170.0080.00018.54
8.1.160.0070.00321.91
8.1.150.0040.00418.54
8.1.140.0000.00717.40
8.1.130.0000.00717.87
8.1.120.0040.00417.45
8.1.110.0030.00517.34
8.1.100.0040.00417.45
8.1.90.0100.00017.41
8.1.80.0000.00717.48
8.1.70.0030.00517.45
8.1.60.0060.00317.61
8.1.50.0030.00517.59
8.1.40.0050.00217.45
8.1.30.0000.00817.64
8.1.20.0040.00417.64
8.1.10.0060.00317.59
8.1.00.0050.00317.55
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0000.00718.46
8.0.270.0030.00317.16
8.0.260.0070.00016.86
8.0.250.0030.00316.93
8.0.240.0070.00017.04
8.0.230.0000.00716.92
8.0.220.0000.00716.89
8.0.210.0000.00716.79
8.0.200.0030.00316.95
8.0.190.0090.00016.98
8.0.180.0040.00416.88
8.0.170.0070.00016.96
8.0.160.0000.00816.91
8.0.150.0030.00316.89
8.0.140.0040.00416.79
8.0.130.0000.00513.37
8.0.120.0050.00316.77
8.0.110.0000.00716.83
8.0.100.0000.00916.98
8.0.90.0020.00516.86
8.0.80.0130.00316.98
8.0.70.0040.00416.79
8.0.60.0020.00516.76
8.0.50.0080.00016.82
8.0.30.0110.01117.05
8.0.20.0120.01217.40
8.0.10.0040.00416.93
8.0.00.0080.00916.79
7.4.330.0000.00515.00
7.4.320.0000.00616.56
7.4.300.0000.00616.52
7.4.290.0000.00716.60
7.4.280.0040.00416.58
7.4.270.0040.00716.55
7.4.260.0070.00016.46
7.4.250.0050.00316.57
7.4.240.0030.00416.56
7.4.230.0050.00216.64
7.4.220.0060.01316.48
7.4.210.0050.01216.65
7.4.200.0000.00716.73
7.4.190.0080.00016.68
7.4.160.0030.01316.34
7.4.150.0190.00017.40
7.4.140.0070.01017.86
7.4.130.0110.00516.60
7.4.120.0070.01016.61
7.4.110.0040.01416.54
7.4.100.0130.00716.52
7.4.90.0090.00916.57
7.4.80.0160.00619.39
7.4.70.0080.00816.54
7.4.60.0000.01516.64
7.4.50.0000.00416.43
7.4.40.0070.00722.77
7.4.30.0100.01016.40
7.3.330.0000.00513.10
7.3.320.0000.00513.36
7.3.310.0030.00316.37
7.3.300.0040.00216.39
7.3.290.0110.00416.24
7.3.280.0150.00316.33
7.3.270.0120.01217.40
7.3.260.0090.01516.50
7.3.250.0110.00616.45
7.3.240.0120.00316.55
7.3.230.0060.01016.40
7.3.210.0090.01216.30
7.3.200.0110.00719.39
7.3.190.0180.00316.28
7.3.180.0120.00916.47
7.3.170.0140.00316.28
7.3.160.0140.00716.35
7.2.330.0110.00816.54
7.2.320.0100.00716.45
7.2.310.0100.00716.30
7.2.300.0000.01616.25
7.2.290.0100.00716.18
5.4.190.0230.04018.99
5.4.180.0200.05019.05
5.4.170.0270.07019.07
5.4.160.0300.04719.06
5.4.150.0270.05719.20
5.4.140.0330.04316.51
5.4.130.0270.04716.50
5.4.120.0170.05316.50
5.4.110.0370.06316.27
5.4.100.0200.03316.41
5.4.90.0170.03716.21
5.4.80.0230.04016.54
5.4.70.0230.03016.25
5.4.60.0200.03316.43
5.4.50.0300.02316.26
5.4.40.0230.03716.52
5.4.30.0270.03316.34
5.4.20.0230.03016.37
5.4.10.0130.04016.43
5.4.00.0230.03015.80
5.3.270.0130.04014.64
5.3.260.0200.04014.54
5.3.250.0230.03014.60
5.3.240.0200.03314.68
5.3.230.0130.04014.66
5.3.220.0230.04714.66
5.3.210.0130.04014.61
5.3.200.0170.03714.64
5.3.190.0170.03714.57
5.3.180.0170.03714.70
5.3.170.0100.04014.60
5.3.160.0230.03014.66
5.3.150.0200.03314.73
5.3.140.0200.03314.50
5.3.130.0200.03714.49
5.3.120.0230.03314.71
5.3.110.0130.04314.68
5.3.100.0170.03714.13
5.3.90.0270.02714.01
5.3.80.0130.04014.01
5.3.70.0200.03013.96
5.3.60.0200.03714.24
5.3.50.0200.03013.86
5.3.40.0200.03013.86
5.3.30.0170.03713.95
5.3.20.0170.03313.86
5.3.10.0270.03013.57
5.3.00.0230.04713.58

preferences:
41.56 ms | 401 KiB | 5 Q