3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { throw new \SoapFault('test-fault-code', 'fault message'); } catch (\SoapFault $e) { echo $e->faultcode, ' ', $e->getCode(), PHP_EOL; var_dump($e); }
based on uYVc9
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'SoapFault' not found in /in/S9iZG:4 Stack trace: #0 {main} thrown in /in/S9iZG on line 4
Process exited with code 255.
Output for 5.4.8 - 5.6.28
Fatal error: Class 'SoapFault' not found in /in/S9iZG on line 4
Process exited with code 255.
Output for 5.3.18 - 5.3.29
test-fault-code 0 object(SoapFault)#1 (9) { ["message":protected]=> string(13) "fault message" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/S9iZG" ["line":protected]=> int(4) ["trace":"Exception":private]=> array(0) { } ["previous":"Exception":private]=> NULL ["faultstring"]=> string(13) "fault message" ["faultcode"]=> string(15) "test-fault-code" }