3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { } class B { public function test(A $a) { if (!$a instanceof A) { die("Fuck type hinting, i am ". (is_object($a) ? get_class($a) : gettype($a)). "! This is SOAP"); } } } class C { } class Test { public function test() { $b = new B(); $b->test(new C()); } } $server = new \SoapServer(null, array("uri" => "http://localhost", "location" => "http://localhost")); $server->setClass("Test"); $server->handle('<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://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:test></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>');
Output for 7.0.0 - 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Test has a deprecated constructor in /in/5UfkU on line 20 Fatal error: Uncaught Error: Class 'SoapServer' not found in /in/5UfkU:29 Stack trace: #0 {main} thrown in /in/5UfkU on line 29
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><faultstring>Argument 1 passed to B::test() must be an instance of A, C given</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Output for 5.4.34 - 5.6.28
Fatal error: Class 'SoapServer' not found in /in/5UfkU on line 29
Process exited with code 255.
Output for 5.3.0 - 5.4.32
Fuck type hinting, i am C! This is SOAP
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5UfkU on line 29 Fuck type hinting, i am C! This is SOAP
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5UfkU on line 29 <?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><faultstring>Argument 1 passed to B::test() must be an instance of A, called in /in/5UfkU on line 25 and defined</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5UfkU on line 29 <?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><faultstring>Argument 1 must be an instance of A</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5UfkU on line 29 <?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><faultstring>Argument 1 must be an instance of A</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
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/5UfkU on line 8
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/5UfkU on line 8
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/5UfkU on line 8
Process exited with code 255.