3v4l.org

run code in 300+ PHP versions simultaneously
<?php # RightNow Cron Job $url = "http://support-upgrade.infoblox.com/cgi-bin/infoblox.cfg/services/soap?wsdl=typed"; $client = new SoapClient($url, array('classmap' => array('Incident' => 'Incident', 'PersonName' => 'PersonName', 'GenericField' => 'GenericField', 'DataValue' => 'DataValue', 'ObjectType' => 'ObjectType', 'UpdateProcessingOptions' => 'UpdateProcessingOptions', 'BatchRequestItem' => 'BatchRequestItem', 'UpdateMsg' => 'UpdateMsg', 'ID'=>'ID'),"trace" => 1)); $headers = array(); class PersonName { var $First; var $Last; } class RunAnalyticsReportMsg { var $AnalyticsReport; var $Limit; var $Start; var $Delimiter; var $ReturnRawResult; var $DisableMTOM; } class AnalyticsReport { var $ID; } class UpdateMsg { var $RNObjects; var $ProcessingOptions; } class BatchRequestItem { var $UpdateMsg; var $CommitAfter; var $PreserveChainID; } class ID { var $ID; } class RNObject { private $id; function RNObject($id) { $this->id=$id; } } class Incident { var $ID; } class Contact { var $ID; var $Name; } class UpdateProcessingOptions { var $SuppressExternalEvents; var $SuppressRules; } class clsWSSEAuth { private $Username; private $Password; function __construct($username, $password) { $this->Username=$username; $this->Password=$password; } } class clsWSSEToken { private $UsernameToken; function __construct ($innerVal){ $this->UsernameToken = $innerVal; } } class App { private $AppID; function __construct($app) { $this->AppID = $app; } } class RNObjectType { var $Namespace; } class DataValue { var $StringValue; var $ObjectValue; var $DateTimeValue; } class GenericObject { var $ObjectType; var $GenericFields; } class GenericField { var $DataValue; var $dataType; var $name; } date_default_timezone_set("America/Chicago"); print("time = ". date("Y-m-d H:i:s") ."\n\n"); #$logfile = './runCXAutoMessagingLog.log'; $logfile = '/var/www/html/cron-jobs/RightNow/runCXAutoMessagingLog.log'; if(filesize($logfile)>6000) unlink($logfile); if (file_exists($logfile)) { $fh = fopen($logfile, "a"); fputs($fh, sprintf("[%s]Automated processing started\n", date("Y-m-d H:i:s"))); fclose($fh); } else { $fh = fopen($logfile, "a"); if($fh==false) die("unable to create file"); fputs($fh, sprintf("[%s]Automated processing started\n", date("Y-m-d H:i:s"))); fclose($fh); } require_once 'config.default.php'; //Check with your provider which security name-space they are using. $strWSSENS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; $objSoapVarUser = new SoapVar($username, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); $objSoapVarPass = new SoapVar($password, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); $objWSSEAuth = new clsWSSEAuth($objSoapVarUser, $objSoapVarPass); $objSoapVarWSSEAuth = new SoapVar($objWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); $objWSSEToken = new clsWSSEToken($objSoapVarWSSEAuth); $objSoapVarWSSEToken = new SoapVar($objWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); $objSoapVarHeaderVal=new SoapVar($objSoapVarWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'Security', $strWSSENS); $objSoapVarWSSEHeader = new SoapHeader($strWSSENS, 'Security', $objSoapVarHeaderVal,true, 'http://abce.com'); $objSoapVarAppID = new SoapVar('testcall', XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); $paramApp = new App($objSoapVarAppID); try { $objSoapVarClientInfoHeader = new SoapHeader("urn:messages.ws.rightnow.com/v1_3", 'ClientInfoHeader',$paramApp,false); $client->__setSoapHeaders(array($objSoapVarClientInfoHeader,$objSoapVarWSSEHeader)); //report ids processReminders(103247,'notify_rma_21day'); //dev 101381 test 101925 processReminders(103248,'notify_rma_28day'); //dev 101382 test 101926 processReminders(103249,'notify_rma_35day'); //dev 101383 test 101927 processReminders(103250,'queue_rma_followup'); //dev 101386 test processClosedSurveys(103246, date('c')); //dev 101384 test 101924 } catch (SoapFault $sf) { //this code was not reached echo $sf->getMessage(); echo $client->__getLastRequest(); echo $client->__getLastResponse(); } catch (Exception $e) { echo $client->__getLastRequest(); echo $client->__getLastResponse(); echo $e->getMessage(); } function processClosedSurveys($rpt_id, $timestamp) { global $client,$logfile; $rptID = array("id"=>$rpt_id); $rpt = new AnalyticsReport(); $rpt->ID = $rptID; $rpt_msg = new RunAnalyticsReportMsg(); $rpt_msg->AnalyticsReport = $rpt; $result = $client->RunAnalyticsReport($rpt_msg); echo $client->__getLastRequest(); print_r($result); //for the batch $batchArr = array(); if($result && $result->CSVTableSet->CSVTables->CSVTable->Rows) { //need in array form, even when one result $resultArr = array(); if(isset($result->CSVTableSet->CSVTables->CSVTable->Rows->Row) && is_array($result->CSVTableSet->CSVTables->CSVTable->Rows->Row)) { for($i=0; $i<count($result->CSVTableSet->CSVTables->CSVTable->Rows->Row); $i++) { $resultArr[] = $result->CSVTableSet->CSVTables->CSVTable->Rows->Row[$i]; } } else if(isset($result->CSVTableSet->CSVTables->CSVTable->Rows->Row)) { $resultArr[] = $result->CSVTableSet->CSVTables->CSVTable->Rows->Row; } foreach($resultArr as $row) { $incident = new Incident(); $incident->ID = array("id"=>$row); $incident->CustomFields = setCustomField("date_survey_sent", $timestamp, "DATETIME"); $upo = new UpdateProcessingOptions(); $upo->SuppressExternalEvents = true; $upo->SuppressRules = false; $updmsg = new UpdateMsg(); $updmsg->RNObjects = $incident; $updmsg->ProcessingOptions = $upo; $bri = new BatchRequestItem(); $bri->UpdateMsg = $updmsg; $bri->CommitAfter = "false"; $batchArr[] = $bri; //$result = $client->update($updmsg); } // end foreach if(count($batchArr) > 0) { $batchChunks = array_chunk($batchArr,90); foreach($batchChunks as $batch){ $result = $client->Batch($batch); print_r($result); } } } //end if result if (file_exists($logfile)) { $fh = fopen($logfile, "a"); fputs($fh, sprintf("[%s]Process Send Surveys:count=%d\n", date("Y-m-d H:i:s"),count($batchArr))); fclose($fh); } } function processReminders($rpt_id, $trigger_message) { global $client,$logfile; //identify rma returns at 21 days $rptID = array("id"=>$rpt_id); $rpt = new AnalyticsReport(); $rpt->ID = $rptID; $rpt_msg = new RunAnalyticsReportMsg(); $rpt_msg->AnalyticsReport = $rpt; $result = $client->RunAnalyticsReport($rpt_msg); echo $client->__getLastRequest(); print_r($result); //for the batch $batchArr = array(); if($result && $result->CSVTableSet->CSVTables->CSVTable->Rows) { //need in array form, even when one result $resultArr = array(); if(isset($result->CSVTableSet->CSVTables->CSVTable->Rows->Row) && is_array($result->CSVTableSet->CSVTables->CSVTable->Rows->Row)) { for($i=0; $i<count($result->CSVTableSet->CSVTables->CSVTable->Rows->Row); $i++) { $resultArr[] = $result->CSVTableSet->CSVTables->CSVTable->Rows->Row[$i]; } } else if(isset($result->CSVTableSet->CSVTables->CSVTable->Rows->Row)) { $resultArr[] = $result->CSVTableSet->CSVTables->CSVTable->Rows->Row; } foreach($resultArr as $row) { $incident = new Incident(); $incident->ID = array("id"=>$row); $incident->CustomFields = setCustomField("trigger_msg", $trigger_message, "STRING"); $upo = new UpdateProcessingOptions(); $upo->SuppressExternalEvents = true; $upo->SuppressRules = false; $updmsg = new UpdateMsg(); $updmsg->RNObjects = $incident; $updmsg->ProcessingOptions = $upo; $bri = new BatchRequestItem(); $bri->UpdateMsg = $updmsg; $bri->CommitAfter = "false"; $batchArr[] = $bri; //$result = $client->update($updmsg); } // end foreach if(count($batchArr) > 0) { $batchChunks = array_chunk($batchArr,90); foreach($batchChunks as $batch){ $result = $client->Batch($batch); } } } //end if result if (file_exists($logfile)) { $fh = fopen($logfile, "a"); fputs($fh, sprintf("[%s]Process Reminders %s:count=%d\n", date("Y-m-d H:i:s"),$trigger_message ,count($batchArr))); fclose($fh); } } function setCustomField($cf_name, $cf_value, $cf_type) { // //set custom field - admin_last_msg // $objtype = new RNObjectType(); $objtype->TypeName = "IncidentCustomFields"; $genobj = new GenericObject(); $genobj->ObjectType = $objtype; $objtype2 = new RNObjectType(); $objtype2->TypeName = "IncidentCustomFields"; $genobj2 = new GenericObject(); $genobj2->ObjectType = $objtype2; $dv_value = new DataValue(); if($cf_type == 'DATETIME') $dv_value->DateTimeValue = $cf_value; else $dv_value->StringValue = $cf_value; $genfld_cfvalue = new GenericField(); $genfld_cfvalue->name = $cf_name; $genfld_cfvalue->dataType = $cf_type; $genfld_cfvalue->DataValue = $dv_value; $genobj2->GenericFields = $genfld_cfvalue; $dv_container = new DataValue(); $dv_container->ObjectValue = $genobj2; $genfld_cf = new GenericField(); $genfld_cf->name = 'c'; $genfld_cf->dataType = "OBJECT"; $genfld_cf->DataValue = $dv_container; $genobj->GenericFields = $genfld_cf; return $genobj; } ?>

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.40.0040.01119.09
8.3.30.0190.00318.76
8.3.20.0040.00420.47
8.3.10.0030.00523.66
8.3.00.0060.00319.85
8.2.170.0120.00322.96
8.2.160.0120.00320.65
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00619.27
8.2.120.0040.00426.35
8.2.110.0030.00722.24
8.2.100.0090.00318.03
8.2.90.0000.00819.29
8.2.80.0000.00818.18
8.2.70.0050.00517.75
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0090.00022.33
8.2.30.0040.00420.72
8.2.20.0040.00417.99
8.2.10.0040.00418.16
8.2.00.0040.00418.23
8.1.270.0090.00620.49
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0030.00623.79
8.1.230.0070.00419.40
8.1.220.0060.00317.80
8.1.210.0040.00418.77
8.1.200.0100.00017.60
8.1.190.0030.00617.47
8.1.180.0090.00018.10
8.1.170.0040.00418.80
8.1.160.0000.00820.84
8.1.150.0000.00819.02
8.1.140.0030.00519.68
8.1.130.0070.00017.70
8.1.120.0000.00817.63
8.1.110.0030.00517.48
8.1.100.0040.00417.50
8.1.90.0030.00717.64
8.1.80.0000.00817.48
8.1.70.0040.00417.54
8.1.60.0080.00017.70
8.1.50.0000.00917.67
8.1.40.0000.00917.71
8.1.30.0040.00417.86
8.1.20.0000.00817.69
8.1.10.0040.00417.68
8.1.00.0050.00317.68
8.0.300.0050.00318.77
8.0.290.0030.00617.00
8.0.280.0020.00518.43
8.0.270.0070.00017.34
8.0.260.0040.00417.29
8.0.250.0030.00317.06
8.0.240.0040.00417.21
8.0.230.0030.00317.04
8.0.220.0040.00417.10
8.0.210.0000.00816.99
8.0.200.0030.00317.16
8.0.190.0030.00517.13
8.0.180.0050.00317.10
8.0.170.0030.00517.06
8.0.160.0000.00817.13
8.0.150.0000.00716.89
8.0.140.0040.00416.94
8.0.130.0030.00313.55
8.0.120.0030.00715.27
8.0.110.0040.00715.31
8.0.100.0040.00315.25
8.0.90.0080.00315.28
8.0.80.0080.00915.25
8.0.70.0070.00415.15
8.0.60.0070.00315.27
8.0.50.0060.00415.21
8.0.30.0080.00715.90
8.0.20.0110.01716.49
8.0.10.0030.00715.41
8.0.00.0080.00816.04
7.4.330.0000.00516.77
7.4.320.0060.00016.68
7.4.300.0070.00016.71
7.4.290.0000.00716.70
7.4.280.0000.00816.79
7.4.270.0040.00416.64
7.4.260.0000.00716.71
7.4.250.0080.00315.11
7.4.240.0030.00715.61
7.4.230.0070.00415.13
7.4.220.0100.00915.12
7.4.210.0060.01115.09
7.4.200.0050.00515.13
7.4.190.0080.00413.52
7.4.180.0000.00913.64
7.4.160.0070.00515.09
7.4.150.0180.00915.44
7.4.140.0130.00616.36
7.4.130.0060.00915.48
7.4.120.0080.00815.62
7.4.110.0080.00715.08
7.4.100.0080.00815.08
7.4.90.0130.00415.09
7.4.80.0080.00716.38
7.4.70.0120.00315.01
7.4.60.0110.00414.96
7.4.50.0110.00414.95
7.4.40.0090.00515.04
7.4.30.0070.01015.04
7.4.20.0000.01313.39
7.4.10.0070.00814.26
7.4.00.0110.00314.63
7.3.330.0000.00613.48
7.3.320.0030.00313.56
7.3.310.0040.00414.91
7.3.300.0080.00014.92
7.3.290.0080.00815.71
7.3.280.0120.00515.74
7.3.270.0050.01015.37
7.3.260.0090.00515.13
7.3.250.0090.00715.75
7.3.240.0090.01015.44
7.3.230.0100.00314.87
7.3.220.0060.00613.14
7.3.210.0110.00314.89
7.3.200.0090.00414.80
7.3.190.0140.00014.92
7.3.180.0050.01114.82
7.3.170.0150.00214.94
7.3.160.0120.00214.78
7.3.150.0000.01013.02
7.3.140.0120.00013.23
7.3.130.0060.01114.34
7.3.120.0050.01014.26
7.3.110.0080.00814.20
7.3.100.0080.00314.17
7.3.90.0060.00614.38
7.3.80.0060.00614.16
7.3.70.0120.00014.15
7.3.60.0100.00114.22
7.3.50.0050.00414.15
7.3.40.0070.00214.26
7.3.30.0050.00514.18
7.3.20.0020.01015.82
7.3.10.0100.00716.16
7.3.00.0090.00615.94
7.2.340.0130.00013.45
7.2.330.0050.01015.06
7.2.320.0100.00614.85
7.2.310.0070.00814.97
7.2.300.0100.00614.98
7.2.290.0080.00814.85
7.2.280.0100.00313.42
7.2.270.0060.00613.45
7.2.260.0090.00714.32
7.2.250.0080.00714.17
7.2.240.0060.00814.23
7.2.230.0090.00114.15
7.2.220.0080.00514.14
7.2.210.0040.01014.20
7.2.200.0090.00514.35
7.2.190.0040.00814.27
7.2.180.0080.00414.29
7.2.170.0080.00414.32
7.2.160.0110.00414.44
7.2.150.0090.00715.88
7.2.140.0070.00716.01
7.2.130.0140.00716.29
7.2.120.0090.00815.88
7.2.110.0080.00616.23
7.2.100.0090.00816.21
7.2.90.0090.00916.11
7.2.80.0080.00816.16
7.2.70.0080.00716.00
7.2.60.0100.00716.29
7.2.50.0070.00716.02
7.2.40.0110.00416.21
7.2.30.0050.01116.05
7.2.20.0110.00616.18
7.2.10.0070.00616.15
7.2.00.0100.00317.04
7.1.330.0060.00814.89
7.1.320.0070.00514.83
7.1.310.0080.00514.90
7.1.300.0060.00914.84
7.1.290.0090.00114.96
7.1.280.0120.00114.81
7.1.270.0080.00814.96
7.1.260.0090.00414.81
7.1.250.0090.00614.98
7.1.240.0080.00514.94
7.1.230.0110.00515.03
7.1.220.0080.01015.08
7.1.210.0070.00814.96
7.1.200.0050.01115.26
7.1.190.0080.00515.03
7.1.180.0110.00515.02
7.1.170.0080.00614.95
7.1.160.0040.01015.06
7.1.150.0090.00615.02
7.1.140.0040.00815.09
7.1.130.0050.00915.13
7.1.120.0080.00614.93
7.1.110.0110.00214.95
7.1.100.0080.00715.71
7.1.90.0050.00615.02
7.1.80.0030.01015.17
7.1.70.0050.00715.54
7.1.60.0060.01016.19
7.1.50.0050.01115.56
7.1.40.0050.00715.09
7.1.30.0060.00515.02
7.1.20.0090.00515.04
7.1.10.0060.00615.11
7.1.00.0080.02016.93
7.0.330.0050.01214.80
7.0.320.0100.00514.77
7.0.310.0090.00414.80
7.0.300.0080.00614.69
7.0.290.0070.00614.79
7.0.280.0010.01314.85
7.0.270.0060.00514.89
7.0.260.0050.00814.83
7.0.250.0050.00614.91
7.0.240.0070.00514.92
7.0.230.0060.00714.94
7.0.220.0030.00814.90
7.0.210.0050.00814.88
7.0.200.0080.00614.82
7.0.190.0080.00514.99
7.0.180.0080.00314.83
7.0.170.0110.00214.77
7.0.160.0090.00414.85
7.0.150.0040.00814.92
7.0.140.0060.00514.90
7.0.130.0090.00414.90
7.0.120.0070.00714.87
7.0.110.0050.01014.90
7.0.100.0050.02716.18
7.0.90.0090.02716.04
7.0.80.0080.02316.18
7.0.70.0080.02316.16
7.0.60.0090.02416.20
7.0.50.0040.02016.33
7.0.40.0050.02515.15
7.0.30.0080.02415.16
7.0.20.0100.02215.19
7.0.10.0060.02115.25
7.0.00.0090.02415.07
5.6.400.0090.00313.46
5.6.390.0130.00313.49
5.6.380.0090.00613.76
5.6.370.0040.01013.74
5.6.360.0050.01013.66
5.6.350.0060.00813.64
5.6.340.0070.00613.79
5.6.330.0070.00713.76
5.6.320.0080.00613.74
5.6.310.0090.00313.70
5.6.300.0040.00713.59
5.6.290.0040.00713.78
5.6.280.0060.01315.54
5.6.270.0050.00813.89
5.6.260.0070.00513.64
5.6.250.0060.02115.55
5.6.240.0080.01815.37
5.6.230.0070.01715.58
5.6.220.0090.02115.40
5.6.210.0050.02515.50
5.6.200.0070.02415.52
5.6.190.0070.01315.60
5.6.180.0060.02215.50
5.6.170.0070.02515.71
5.6.160.0050.02715.67
5.6.150.0070.02515.62
5.6.140.0080.02315.69
5.6.130.0070.02715.67
5.6.120.0100.02315.65
5.6.110.0070.01815.62
5.6.100.0100.01915.64
5.6.90.0070.02415.59
5.6.80.0090.02315.39
5.6.70.0060.02015.54
5.6.60.0080.01815.50
5.6.50.0090.02115.44
5.6.40.0060.02615.41
5.6.30.0080.02415.47
5.6.20.0080.02615.29
5.6.10.0060.02315.29
5.6.00.0060.01715.39
5.5.380.0060.01414.48
5.5.370.0070.01514.51
5.5.360.0090.01814.39
5.5.350.0100.02214.41
5.5.340.0050.02714.62
5.5.330.0040.02714.66
5.5.320.0050.02514.67
5.5.310.0090.02414.72
5.5.300.0040.02514.73
5.5.290.0050.02314.70
5.5.280.0060.02514.64
5.5.270.0070.02214.60
5.5.260.0050.02814.65
5.5.250.0040.02314.53
5.5.240.0080.01314.58
5.5.230.0080.02414.55
5.5.220.0050.02114.43
5.5.210.0060.01614.44
5.5.200.0060.01914.52
5.5.190.0060.01714.47
5.5.180.0070.02514.37
5.5.170.0070.00612.54
5.5.160.0070.02014.39
5.5.150.0050.01614.34
5.5.140.0070.02514.51
5.5.130.0070.02414.43
5.5.120.0060.02014.45
5.5.110.0060.02514.41
5.5.100.0060.02514.49
5.5.90.0040.02714.51
5.5.80.0070.02414.49
5.5.70.0040.01914.45
5.5.60.0040.02814.40
5.5.50.0060.02614.53
5.5.40.0060.02214.39
5.5.30.0080.02514.39
5.5.20.0070.01614.36
5.5.10.0070.02514.42
5.5.00.0050.02214.52

preferences:
49.07 ms | 400 KiB | 5 Q