3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PixelHandling extends SoapClient{ // Client connection private $soapclient_options = array('login' => 'SlevogtE', 'password' => 'BBDEXI', 'trace' => 1); private $wsdl = 'https://' . $soapclient_options['login'] . ':' . $soapclient_options['password'] . '@tom-test.vgwort.de/services/1.0/pixelService.wsdl' ; private $client; function __construct(){ $this->client = new SoapClient($wsdl, $soapclient_options); } // Publicly accessible parameters public $publId; public $privId; public $orderDateTime; public $pixels; private function objToArr($d){ if (is_object($d)){ $d = get_object_vars($d); } if (is_array($d)){ return array_map(__FUNCTION__, $d); } else{ return $d; } } // Order Pixel (amount) --> pixels will be written to array $pixels public function orderNewPixel($amount){ $params = new StdClass(); $params->count = $amount; try{ $result = $this->client->orderPixel($params); $pixels = objToArr($result->pixels); $orderDateTime = $result->orderDateTime; // foreach($result->pixels as $val){ // array_push($pixels, $val); // } $publId = $result->publicIdentificationId; $privId = $result->privateIdentificationId; } catch(SoapFault $e){ echo "Fehlercode: ", $result->errorcode, "\n"; echo "Message: ", $result->errormsg, "\n"; echo "Folgende Anzahl wäre möglich gewesen: ", $result->maxOrder, "\n"; } } public function getPixels(){ print_r($this->pixels); foreach ($this->pixels as $key) { echo $key; } } } // 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); $test->getPixels(); ?>
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /in/nlAv0 on line 7
Process exited with code 255.

preferences:
169.56 ms | 1395 KiB | 65 Q