3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class SoapClientEx extends SoapClient { /** * @var null|SoapServer */ protected $server = null; public function __construct($server, array $options) { parent::__construct(null, $options); $this->server = $server; } public function __doRequest($request, $location, $action, $version, $one_way = 0) { ob_start(); $this->server->handle($request); header_remove(); return ob_get_clean(); } } class Test { function mult($a, $b) { return $a * $b; } } $server = new SoapServer(null, array( 'uri' => 'localhost' )); $server->setClass('Test'); $client = new SoapClientEx($server, array( 'uri' => 'localhost', 'location' => 'localhost' )); $result = $client->mult(2,3); echo $result;
Output for 7.0.0 - 7.1.0
Fatal error: Class 'SoapClient' not found in /in/EqTBs on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> Warning: Cannot modify header information - headers already sent in /in/EqTBs on line 21 Fatal error: Uncaught SoapFault exception: [Client] SoapClient::__doRequest() returned non string value
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Class 'SoapClient' not found in /in/EqTBs on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.29
6
Output for 5.2.14 - 5.2.17
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="localhost" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:multResponse><return xsi:type="xsd:int">6</return></ns1:multResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> Fatal error: Uncaught SoapFault exception: [Client] Call to undefined function header_remove() in /in/EqTBs:21 Stack trace: #0 /in/EqTBs(21): SoapClientEx::__doRequest() #1 [internal function]: SoapClientEx->__doRequest('<?xml version="...', 'localhost', 'localhost#mult', 1, 0) #2 /in/EqTBs(42): SoapClient->__call('mult', Array) #3 /in/EqTBs(42): SoapClientEx->mult(2, 3) #4 {main} thrown in /in/EqTBs on line 21
Process exited with code 255.
Output for 5.1.3 - 5.2.13
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="localhost" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:multResponse><return xsi:type="xsd:int">6</return></ns1:multResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> Fatal error: Uncaught SoapFault exception: [Client] Call to undefined function header_remove() in /in/EqTBs:21 Stack trace: #0 /in/EqTBs(21): SoapClientEx::__doRequest() #1 [internal function]: SoapClientEx->__doRequest('<?xml version="...', 'localhost', 'localhost#mult', 1, 0) #2 [internal function]: SoapClient->__call('mult', Array) #3 /in/EqTBs(42): SoapClientEx->mult(2, 3) #4 {main} thrown in /in/EqTBs on line 21
Process exited with code 255.
Output for 5.1.0 - 5.1.2
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="localhost" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:multResponse><return xsi:type="xsd:int">6</return></ns1:multResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> Fatal error: Uncaught SoapFault exception: [Client] Call to undefined function header_remove() in /in/EqTBs:21 Stack trace: #0 /in/EqTBs(21): SoapClientEx::__doRequest() #1 [internal function]: SoapClientEx->__doRequest('<?xml version="...', 'localhost', 'localhost#mult', 1) #2 [internal function]: SoapClient->__call('mult', Array) #3 /in/EqTBs(42): SoapClientEx->mult(2, 3) #4 {main} thrown in /in/EqTBs on line 21
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/EqTBs on line 11
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/EqTBs on line 9
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/EqTBs on line 9
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/EqTBs on line 9
Process exited with code 255.