3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Pixel { public $orderDateTime; public $domain; public $publId; public $privId; } class PixelHandling extends SoapClient{ // Client connection private $clientopts; private $wsdl; private $client; function __construct(){ $this->clientopts = array('login' => 'SlevogtE', 'password' => 'BBDEXI', 'trace' => 1); $this->wsdl = 'https://' . $clientopts['login'] . ':' . $clientopts['password'] . '@tom-test.vgwort.de/services/1.0/pixelService.wsdl' ; $this->client = new SoapClient($wsdl, $clientopts); } // Order Pixel (amount) --> pixels will be written to array $pixels public function orderNewPixel($amount){ $params = new StdClass(); $params->count = $amount; $arr = array(); try{ $result = $this->client->orderPixel($params); foreach($result as $val){ $pixels = new Pixel(); $pixels->orderDateTime = $val->orderDateTime; $pixels->domain = $val->domain; $pixels->publId = $val->pixels->publicIdentificationId; $pixels->privId = $val->pixels->privateIdentificationId; array_push($arr, $pixels); } } catch(SoapFault $e){ echo "Fehlercode: ", $result->errorcode, "\n"; echo "Message: ", $result->errormsg, "\n"; echo "Folgende Anzahl waere moeglich gewesen: ", $result->maxOrder, "\n"; } return $arr; } } // Check whether Soap can be even used.. if(!class_exists('SoapClient')){ echo '<script type="text/javascript" language="Javascript">alert("Fehler: PHP-Modul fehlt.")</script>'; } $test = new PixelHandling(); $test->orderNewPixel(2); // Format für Pixel export // <IMG src="domain.met.vgwort.de/na/c5b7568d28884052a9ff92d5afd08f34" // height="1" width="1" border=“0“> ?>
Output for 5.4.34 - 5.6.21, 7.0.0 - 7.1.0
Fatal error: Class 'SoapClient' not found in /in/50Kan on line 12
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Fatal error: Uncaught exception 'Exception' with message '__construct() expects parameter 2 to be array, null given' in /in/50Kan:22 Stack trace: #0 /in/50Kan(22): SoapClient->__construct() #1 /in/50Kan(62): PixelHandling->__construct() #2 {main}
Process exited with code 255.
Output for 5.3.0 - 5.4.32
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient(): Invalid parameters in /in/50Kan:22 Stack trace: #0 /in/50Kan(22): SoapClient->SoapClient(NULL, NULL) #1 /in/50Kan(62): PixelHandling->__construct() #2 {main} thrown in /in/50Kan on line 22
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Warning: SoapClient::SoapClient() expects parameter 2 to be array, null given in /in/50Kan on line 22 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient(): Invalid parameters in /in/50Kan:22 Stack trace: #0 /in/50Kan(22): SoapClient->SoapClient(NULL, NULL) #1 /in/50Kan(62): PixelHandling->__construct() #2 {main} thrown in /in/50Kan on line 22
Process exited with code 255.
Output for 5.0.5 - 5.1.6
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Warning: SoapClient::__construct() expects parameter 2 to be array, null given in /in/50Kan on line 22 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__construct(): Invalid parameters in /in/50Kan:22 Stack trace: #0 /in/50Kan(22): SoapClient->__construct(NULL, NULL) #1 /in/50Kan(62): PixelHandling->__construct() #2 {main} thrown in /in/50Kan on line 22
Process exited with code 255.
Output for 5.0.4
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Warning: __construct() expects parameter 2 to be array, null given in /in/50Kan on line 22
Process exited with code 139.
Output for 5.0.3
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] SoapClient::__construct(): Invalid parameters. in /in/50Kan:22 Stack trace: #0 /in/50Kan(22): SoapClient->__construct(NULL, NULL) #1 /in/50Kan(62): PixelHandling->__construct() #2 {main} thrown in /in/50Kan on line 22
Process exited with code 255.
Output for 5.0.2
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] SoapClient::__construct(): Invalid parameters. in /in/50Kan:22 Stack trace: #0 /in/50Kan(62): PixelHandling->__construct(NULL, NULL) #1 {main} thrown in /in/50Kan on line 22
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: clientopts in /in/50Kan on line 21 Notice: Undefined variable: wsdl in /in/50Kan on line 22 Notice: Undefined variable: clientopts in /in/50Kan on line 22 Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] SoapClient::SoapClient(): Invalid parameters. in /in/50Kan:22 Stack trace: #0 /in/50Kan(62): PixelHandling->__construct(NULL, NULL) #1 {main} thrown in /in/50Kan on line 22
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/50Kan on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/50Kan on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/50Kan on line 5
Process exited with code 255.