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 = md5('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)
5.4.190.0160.05012.39
5.4.180.0200.04012.40
5.4.170.0190.04212.40
5.4.160.0200.04412.39
5.4.150.0120.05112.39
5.4.140.0160.04612.09
5.4.130.0130.04912.07
5.4.120.0210.04112.03
5.4.110.0200.03812.03
5.4.100.0160.04912.02
5.4.90.0130.04512.02
5.4.80.0160.04512.03
5.4.70.0150.04512.02
5.4.60.0210.03712.02
5.4.50.0190.04012.02
5.4.40.0180.04012.01
5.4.30.0240.05012.00
5.4.20.0210.04412.01
5.4.10.0160.04612.01
5.4.00.0310.14711.49
5.3.270.0320.06612.72
5.3.260.0220.04212.72
5.3.250.0260.09812.72
5.3.240.0160.04812.72
5.3.230.0190.04512.71
5.3.220.0140.04812.68
5.3.210.0180.05112.68
5.3.200.0170.05612.68
5.3.190.0340.10012.68
5.3.180.0180.05212.67
5.3.170.0210.04512.67
5.3.160.0220.04012.67
5.3.150.0170.04712.67
5.3.140.0180.04712.66
5.3.130.0180.04512.66
5.3.120.0190.04612.66
5.3.110.0180.04912.66
5.3.100.0160.04712.12
5.3.90.0160.04612.10
5.3.80.0180.10612.09
5.3.70.0190.04912.09
5.3.60.0200.04112.07
5.3.50.0160.04512.02
5.3.40.0140.04712.02
5.3.30.0190.04011.99
5.3.20.0160.04611.77
5.3.10.0160.04411.73
5.3.00.0160.04511.71

preferences:
138.41 ms | 1394 KiB | 7 Q