3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pixel { public $orderDateTime; public $domain; public $publId; public $privId; } class PixelHandling extends SoapClient{ // Client connection private $client_options = array('login' => 'SlevogtE', 'password' => 'BBDEXI', 'trace' => 1); private $wsdl; private $client; function __construct(){ $this->wsdl = 'https://' . $client_options['login'] . ':' . $client_options['password'] . '@tom-test.vgwort.de/services/1.0/pixelService.wsdl' ; $this->client = new SoapClient($wsdl, $client_options); } // 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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Class "SoapClient" not found in /in/eNopo:12 Stack trace: #0 {main} thrown in /in/eNopo on line 12
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'SoapClient' not found in /in/eNopo:12 Stack trace: #0 {main} thrown in /in/eNopo on line 12
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Fatal error: Class 'SoapClient' not found in /in/eNopo on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient(): Invalid parameters in /in/eNopo:21 Stack trace: #0 /in/eNopo(21): SoapClient->SoapClient(NULL, NULL) #1 /in/eNopo(61): PixelHandling->__construct() #2 {main} thrown in /in/eNopo on line 21
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Warning: SoapClient::SoapClient() expects parameter 2 to be array, null given in /in/eNopo on line 21 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient(): Invalid parameters in /in/eNopo:21 Stack trace: #0 /in/eNopo(21): SoapClient->SoapClient(NULL, NULL) #1 /in/eNopo(61): PixelHandling->__construct() #2 {main} thrown in /in/eNopo on line 21
Process exited with code 255.
Output for 5.0.5, 5.1.0 - 5.1.6
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Warning: SoapClient::__construct() expects parameter 2 to be array, null given in /in/eNopo on line 21 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__construct(): Invalid parameters in /in/eNopo:21 Stack trace: #0 /in/eNopo(21): SoapClient->__construct(NULL, NULL) #1 /in/eNopo(61): PixelHandling->__construct() #2 {main} thrown in /in/eNopo on line 21
Process exited with code 255.
Output for 5.0.4
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Warning: __construct() expects parameter 2 to be array, null given in /in/eNopo on line 21
Process exited with code 139.
Output for 5.0.3
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] SoapClient::__construct(): Invalid parameters. in /in/eNopo:21 Stack trace: #0 /in/eNopo(21): SoapClient->__construct(NULL, NULL) #1 /in/eNopo(61): PixelHandling->__construct() #2 {main} thrown in /in/eNopo on line 21
Process exited with code 255.
Output for 5.0.2
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] SoapClient::__construct(): Invalid parameters. in /in/eNopo:21 Stack trace: #0 /in/eNopo(61): PixelHandling->__construct(NULL, NULL) #1 {main} thrown in /in/eNopo on line 21
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: client_options in /in/eNopo on line 20 Notice: Undefined variable: wsdl in /in/eNopo on line 21 Notice: Undefined variable: client_options in /in/eNopo on line 21 Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] SoapClient::SoapClient(): Invalid parameters. in /in/eNopo:21 Stack trace: #0 /in/eNopo(61): PixelHandling->__construct(NULL, NULL) #1 {main} thrown in /in/eNopo on line 21
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/eNopo on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/eNopo 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/eNopo on line 5
Process exited with code 255.

preferences:
327.62 ms | 401 KiB | 456 Q