3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Class "SoapClient" not found in /in/EqTBs:4 Stack trace: #0 {main} thrown in /in/EqTBs on line 4
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/EqTBs:4 Stack trace: #0 {main} thrown in /in/EqTBs on line 4
Process exited with code 255.
Output for 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/EqTBs on line 4
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
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.1.6, 5.2.0 - 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.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/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.

preferences:
275.27 ms | 401 KiB | 459 Q