3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $phoneNumber = '972544273449'; $content = 'Bob'; ini_set('soap.wsdl_cache_enabled', '0'); $options = array('soap_version' => SOAP_1_2); $url = 'http://smsotp.fpt.vn/Service.asmx/SendSMS'; if(substr($phoneNumber,0, 1)=='0'){ $phoneNumber = '84'.substr($phoneNumber,1, strlen($phoneNumber)); } try { $client = @new SoapClient($url, $options); $params = array( 'PhoneNumber' => $phoneNumber, 'Message' => $content, 'Resource' => 3 ); $result = $client->SendSMS($params); } catch (SoapFault $e) { $result = $e->getMessage(); } return $result;
based on GELEt
Output for 7.2.0
Warning: Use of undefined constant SOAP_1_2 - assumed 'SOAP_1_2' (this will throw an Error in a future version of PHP) in /in/pbnVl on line 7 Fatal error: Uncaught Error: Class 'SoapClient' not found in /in/pbnVl:14 Stack trace: #0 {main} thrown in /in/pbnVl on line 14
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant SOAP_1_2 - assumed 'SOAP_1_2' in /in/pbnVl on line 7 Fatal error: Uncaught Error: Class 'SoapClient' not found in /in/pbnVl:14 Stack trace: #0 {main} thrown in /in/pbnVl on line 14
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Notice: Use of undefined constant SOAP_1_2 - assumed 'SOAP_1_2' in /in/pbnVl on line 7
Process exited with code 255.
Output for 5.0.4 - 5.3.29

Process exited with code 255.
Output for 5.0.0 - 5.0.3
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/pbnVl on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/pbnVl on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/pbnVl on line 13
Process exited with code 255.