3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Extends SoapClient (PHP native) for EMS authentication process class SoapClientEMS extends SoapClient { const EMS_WS_NAMESPACE = 'http://ws.ems6.net/'; function SoapClientEMS($Login, $Password, $Idmlist, $wsdl, $options = array()) { parent::__construct($wsdl, $options); $this->__setSoapHeaders($this->createHeader($Login, $Password, $Idmlist)); } private function createHeader($Login, $Password, $Idmlist) { @$struct->UserName = new SoapVar($Login, XSD_STRING, null, null, null, self::EMS_WS_NAMESPACE); $struct->Password = new SoapVar($Password, XSD_STRING, null, null, null, self::EMS_WS_NAMESPACE); $struct->IdMlist = new SoapVar($Idmlist, XSD_INTEGER, null, null, null, self::EMS_WS_NAMESPACE); $header_values = new SoapVar($struct, SOAP_ENC_OBJECT, null, null,null, self::EMS_WS_NAMESPACE); $header = new SoapHeader(self::EMS_WS_NAMESPACE, "AuthHeader", $header_values); return $header; } } // declare variables for soap authentication // API LOGIN $Login = 'Email_API'; // API SECRET $Pwd = 'i8piZZa4u'; // DATABASE $Idmlist = '2093191961'; $mySegment = new SoapClientEMS( $Login, $Pwd, $Idmlist, "https://api.cheetahmail.fr/v1/segment.asmx?WSDL", $Options = array()); // WebMethod call $result = $mySegment->ListSegment(); //Affichage du Results brut if(isset($result->ListSegmentResult->string)){ if(count($result->ListSegmentResult->string) == 1){ echo $result->ListSegmentResult->string; } else{ foreach ($result->ListSegmentResult->string as $segment) { echo $segment; } } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "SoapClient" not found in /in/gk98g:5 Stack trace: #0 {main} thrown in /in/gk98g on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.6 ms | 401 KiB | 8 Q