3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $host = "c3-test.wirecard.com"; $port = 443; $path = "/secure/ssl-gateway"; $login = "56500"; $pass = "TestXAPTER"; $errno = "401"; $errstr = "auther"; $poststring = "<?xml version='1.0' encoding='UTF-8'?> <WIRECARD_BXML xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' xsi:noNamespaceSchemaLocation='wirecard.xsd'> <W_REQUEST> <W_JOB> <JobID>job 2</JobID> <BusinessCaseSignature>56500</BusinessCaseSignature> <FNC_CC_TRANSACTION> <FunctionID>WireCard Test</FunctionID> <CC_TRANSACTION mode='demo'> <TransactionID>2</TransactionID> <Amount>10</Amount> <Currency>USD</Currency> <CountryCode>US</CountryCode> <RECURRING_TRANSACTION> <Type>Single</Type> </RECURRING_TRANSACTION> <CREDIT_CARD_DATA> <CreditCardNumber>4200000000000000</CreditCardNumber> <CVC2>000</CVC2> <ExpirationYear>2016</ExpirationYear> <ExpirationMonth>01</ExpirationMonth> <CardHolderName>Wirecard Test</CardHolderName> </CREDIT_CARD_DATA> <CONTACT_DATA> <IPAddress>67.29.138.2</IPAddress> </CONTACT_DATA> <CORPTRUSTCENTER_DATA> <ADDRESS> <Address1></Address1> <City></City> <ZipCode></ZipCode> <State></State> <Country></Country> <Phone></Phone> <Email>support@wirecard.com</Email> </ADDRESS> </CORPTRUSTCENTER_DATA> </CC_TRANSACTION> </FNC_CC_TRANSACTION> </W_JOB> </W_REQUEST> </WIRECARD_BXML>"; $fp = fsockopen("ssl://".$host, $port, $errno, $errstr, 5); if(!$fp){ //error; tell us echo "Error: $errstr ($errno)\n"; }else{ //send the server request fputs($fp, "POST $path HTTP/1.0\r\n"); fputs($fp, "Host: $host\r\n"); fputs($fp,"Content-type: text/xml\r\n"); fputs($fp, "Content-length: ".strlen($poststring)."\r\n"); fputs($fp, "Authorization: Basic ".base64_encode($login.":".$pass."\r\n")); fputs($fp, "Connection: close\r\n"); fputs($fp,"\r\n"); fputs($fp, $poststring . "\r\n\r\n"); // prepare for reading the response stream_set_timeout($fp,30); // here we save the response body - XML response from WireCard $output = ""; // here we store the HTTP headers $headers= ""; // temp. variable for detecting the end of HTTP headers. $is_header = 1; while(!feof($fp)) { $buffer = fgets($fp, 128); // fgets on SSL socket if ($buffer == FALSE) { break; } if (!$is_header) { $output .= $buffer; } if ($buffer == "\r\n") { $is_header = 0; } if ($is_header) { $headers .= $buffer; } } //close fp - we are done with it fclose($fp); // print the results in Web Browser - and convert all special // characters (like <,>,...) to HTML entities echo "<PRE>\n"; echo htmlentities($headers); echo "\n"; echo htmlentities($output); echo "</PRE>\n"; } ?>
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/v17sn on line 114 Warning: fsockopen(): unable to connect to ssl://c3-test.wirecard.com:443 (php_network_getaddresses: getaddrinfo failed: System error) in /in/v17sn on line 114 Error: php_network_getaddresses: getaddrinfo failed: System error (0)
Output for 5.4.15 - 7.0.10, 7.1.0
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/v17sn on line 114 Warning: fsockopen(): unable to connect to ssl://c3-test.wirecard.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/v17sn on line 114 Error: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)
Output for 5.4.1 - 5.4.11, 5.4.14
Warning: fsockopen(): unable to connect to ssl://c3-test.wirecard.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/v17sn on line 114 Error: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0)
Output for 5.4.13
Warning: fsockopen(): unable to connect to ssl://c3-test.wirecard.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/v17sn on line 114 Error: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32547)
Output for 5.4.12
Warning: fsockopen(): unable to connect to ssl://c3-test.wirecard.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/v17sn on line 114 Error: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32697)
Output for 5.4.0
Warning: fsockopen(): unable to connect to ssl://c3-test.wirecard.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/v17sn on line 114 Error: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32657)