3v4l.org

run code in 300+ PHP versions simultaneously
<?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("https://".$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"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 99
Branch analysis from position: 99
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 83
Branch analysis from position: 104
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 91
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 104
Branch analysis from position: 104
Branch analysis from position: 91
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 94
Branch analysis from position: 93
2 jumps found. (Code = 43) Position 1 = 96, Position 2 = 97
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 98, Position 2 = 99
Branch analysis from position: 98
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 83
Branch analysis from position: 104
Branch analysis from position: 83
Branch analysis from position: 99
Branch analysis from position: 97
Branch analysis from position: 94
filename:       /in/kQltN
function name:  (null)
number of ops:  119
compiled vars:  !0 = $host, !1 = $port, !2 = $path, !3 = $login, !4 = $pass, !5 = $errno, !6 = $errstr, !7 = $poststring, !8 = $fp, !9 = $output, !10 = $headers, !11 = $is_header, !12 = $buffer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'c3-test.wirecard.com'
    5     1        ASSIGN                                                   !1, 443
    7     2        ASSIGN                                                   !2, '%2Fsecure%2Fssl-gateway'
    9     3        ASSIGN                                                   !3, '56500'
   11     4        ASSIGN                                                   !4, 'TestXAPTER'
   13     5        ASSIGN                                                   !5, '401'
   14     6        ASSIGN                                                   !6, 'auther'
   16     7        ASSIGN                                                   !7, '%3C%3Fxml+version%3D%271.0%27+encoding%3D%27UTF-8%27%3F%3E%0A%0A%0A%0A%3CWIRECARD_BXML+xmlns%3Axsi%3D%27http%3A%2F%2Fwww.w3.org%2F1999%2FXMLSchema-instance%27+xsi%3AnoNamespaceSchemaLocation%3D%27wirecard.xsd%27%3E%0A%0A%09%3CW_REQUEST%3E%0A%0A%09%09%3CW_JOB%3E%0A%0A%09%09%09%3CJobID%3Ejob+2%3C%2FJobID%3E+%0A%0A%09%09%09%3CBusinessCaseSignature%3E56500%3C%2FBusinessCaseSignature%3E%0A%0A%09%09%09%3CFNC_CC_TRANSACTION%3E%0A%0A%09%09%09%09%3CFunctionID%3EWireCard+Test%3C%2FFunctionID%3E+%0A%0A%09%09%09%09%0A%0A%09%09%09%09%3CCC_TRANSACTION+mode%3D%27demo%27%3E%0A%0A%09%09%09%09%09%3CTransactionID%3E2%3C%2FTransactionID%3E%0A%0A%09%09%09%09%09%3CAmount%3E10%3C%2FAmount%3E%0A%0A%09%09%09%09%09%3CCurrency%3EUSD%3C%2FCurrency%3E%0A%0A%09%09%09%09%09%3CCountryCode%3EUS%3C%2FCountryCode%3E%0A%0A%09%09%09%09%09%0A%0A%09%09%09%09%09%3CRECURRING_TRANSACTION%3E+%0A%0A%09%09%09%09%09%09%3CType%3ESingle%3C%2FType%3E%0A%0A%09%09%09%09%09%3C%2FRECURRING_TRANSACTION%3E+%0A%0A%09%09%09%09%09%0A%0A%09%09%09%09%09%3CCREDIT_CARD_DATA%3E%0A%0A%09%09%09%09%09%09%3CCreditCardNumber%3E4200000000000000%3C%2FCreditCardNumber%3E%0A%0A%09%09%09%09%09%09%3CCVC2%3E000%3C%2FCVC2%3E%0A%0A%09%09%09%09%09%09%3CExpirationYear%3E2016%3C%2FExpirationYear%3E%0A%0A%09%09%09%09%09%09%3CExpirationMonth%3E01%3C%2FExpirationMonth%3E%0A%0A%09%09%09%09%09%09%3CCardHolderName%3EWirecard+Test%3C%2FCardHolderName%3E%0A%0A%09%09%09%09%09%3C%2FCREDIT_CARD_DATA%3E%0A%0A%09%09%09%09%09%3CCONTACT_DATA%3E%0A%0A%09%09%09%09%09%09%3CIPAddress%3E67.29.138.2%3C%2FIPAddress%3E+%0A%0A%09%09%09%09%09%3C%2FCONTACT_DATA%3E%0A%0A%09%09%09%09%09%0A%0A%09%09%09%09%09%3CCORPTRUSTCENTER_DATA%3E%0A%0A%09%09%09%09%09%09%3CADDRESS%3E%0A%0A%09%09%09%09%09%09%3CAddress1%3E%3C%2FAddress1%3E%0A%0A%09%09%09%09%09%09%3CCity%3E%3C%2FCity%3E%0A%0A%09%09%09%09%09%09%3CZipCode%3E%3C%2FZipCode%3E%0A%0A%09%09%09%09%09%09%3CState%3E%3C%2FState%3E%0A%0A%09%09%09%09%09%09%3CCountry%3E%3C%2FCountry%3E%0A%0A%09%09%09%09%09%09%3CPhone%3E%3C%2FPhone%3E+%0A%0A%09%09%09%09%09%09%3CEmail%3Esupport%40wirecard.com%3C%2FEmail%3E%0A%0A%09%09%09%09%09%09%3C%2FADDRESS%3E%0A%0A%09%09%09%09%09%3C%2FCORPTRUSTCENTER_DATA%3E%0A%0A%09%09%09%09%09%0A%0A%09%09%09%09%3C%2FCC_TRANSACTION%3E%0A%0A%09%09%09%09%0A%0A%09%09%09%3C%2FFNC_CC_TRANSACTION%3E%0A%0A%09%09%3C%2FW_JOB%3E%0A%0A%09%3C%2FW_REQUEST%3E%0A%0A%3C%2FWIRECARD_BXML%3E'
  114     8        INIT_FCALL                                               'fsockopen'
          9        CONCAT                                           ~21     'https%3A%2F%2F', !0
         10        SEND_VAL                                                 ~21
         11        SEND_VAR                                                 !1
         12        SEND_REF                                                 !5
         13        SEND_REF                                                 !6
         14        SEND_VAL                                                 5
         15        DO_ICALL                                         $22     
         16        ASSIGN                                                   !8, $22
  115    17        BOOL_NOT                                         ~24     !8
         18      > JMPZ                                                     ~24, ->26
  117    19    >   ROPE_INIT                                     5  ~26     'Error%3A+'
         20        ROPE_ADD                                      1  ~26     ~26, !6
         21        ROPE_ADD                                      2  ~26     ~26, '+%28'
         22        ROPE_ADD                                      3  ~26     ~26, !5
         23        ROPE_END                                      4  ~25     ~26, '%29%0A'
         24        ECHO                                                     ~25
         25      > JMP                                                      ->118
  120    26    >   INIT_FCALL                                               'fputs'
         27        SEND_VAR                                                 !8
         28        ROPE_INIT                                     3  ~30     'POST+'
         29        ROPE_ADD                                      1  ~30     ~30, !2
         30        ROPE_END                                      2  ~29     ~30, '+HTTP%2F1.0%0D%0A'
         31        SEND_VAL                                                 ~29
         32        DO_ICALL                                                 
  121    33        INIT_FCALL                                               'fputs'
         34        SEND_VAR                                                 !8
         35        ROPE_INIT                                     3  ~34     'Host%3A+'
         36        ROPE_ADD                                      1  ~34     ~34, !0
         37        ROPE_END                                      2  ~33     ~34, '%0D%0A'
         38        SEND_VAL                                                 ~33
         39        DO_ICALL                                                 
  122    40        INIT_FCALL                                               'fputs'
         41        SEND_VAR                                                 !8
         42        SEND_VAL                                                 'Content-type%3A+text%2Fxml%0D%0A'
         43        DO_ICALL                                                 
  123    44        INIT_FCALL                                               'fputs'
         45        SEND_VAR                                                 !8
         46        STRLEN                                           ~38     !7
         47        CONCAT                                           ~39     'Content-length%3A+', ~38
         48        CONCAT                                           ~40     ~39, '%0D%0A'
         49        SEND_VAL                                                 ~40
         50        DO_ICALL                                                 
  124    51        INIT_FCALL                                               'fputs'
         52        SEND_VAR                                                 !8
  125    53        INIT_FCALL                                               'base64_encode'
         54        CONCAT                                           ~42     !3, '%3A'
         55        CONCAT                                           ~43     ~42, !4
         56        CONCAT                                           ~44     ~43, '%0D%0A'
         57        SEND_VAL                                                 ~44
         58        DO_ICALL                                         $45     
         59        CONCAT                                           ~46     'Authorization%3A%0ABasic+', $45
         60        SEND_VAL                                                 ~46
         61        DO_ICALL                                                 
  126    62        INIT_FCALL                                               'fputs'
         63        SEND_VAR                                                 !8
         64        SEND_VAL                                                 'Connection%3A+close%0D%0A'
         65        DO_ICALL                                                 
  127    66        INIT_FCALL                                               'fputs'
         67        SEND_VAR                                                 !8
         68        SEND_VAL                                                 '%0D%0A'
         69        DO_ICALL                                                 
  128    70        INIT_FCALL                                               'fputs'
         71        SEND_VAR                                                 !8
         72        CONCAT                                           ~50     !7, '%0D%0A%0D%0A'
         73        SEND_VAL                                                 ~50
         74        DO_ICALL                                                 
  130    75        INIT_FCALL                                               'stream_set_timeout'
         76        SEND_VAR                                                 !8
         77        SEND_VAL                                                 30
         78        DO_ICALL                                                 
  132    79        ASSIGN                                                   !9, ''
  134    80        ASSIGN                                                   !10, ''
  136    81        ASSIGN                                                   !11, 1
  137    82      > JMP                                                      ->99
  138    83    >   INIT_FCALL                                               'fgets'
         84        SEND_VAR                                                 !8
         85        SEND_VAL                                                 128
         86        DO_ICALL                                         $56     
         87        ASSIGN                                                   !12, $56
  140    88        BOOL_NOT                                         ~58     !12
         89      > JMPZ                                                     ~58, ->91
  141    90    > > JMP                                                      ->104
  143    91    >   BOOL_NOT                                         ~59     !11
         92      > JMPZ                                                     ~59, ->94
  144    93    >   ASSIGN_OP                                     8          !9, !12
  146    94    >   IS_EQUAL                                                 !12, '%0D%0A'
         95      > JMPZ                                                     ~61, ->97
  147    96    >   ASSIGN                                                   !11, 0
  149    97    > > JMPZ                                                     !11, ->99
  150    98    >   ASSIGN_OP                                     8          !10, !12
  137    99    >   INIT_FCALL                                               'feof'
        100        SEND_VAR                                                 !8
        101        DO_ICALL                                         $64     
        102        BOOL_NOT                                         ~65     $64
        103      > JMPNZ                                                    ~65, ->83
  154   104    >   INIT_FCALL                                               'fclose'
        105        SEND_VAR                                                 !8
        106        DO_ICALL                                                 
  157   107        ECHO                                                     '%3CPRE%3E%0A'
  158   108        INIT_FCALL                                               'htmlentities'
        109        SEND_VAR                                                 !10
        110        DO_ICALL                                         $67     
        111        ECHO                                                     $67
  159   112        ECHO                                                     '%0A'
  160   113        INIT_FCALL                                               'htmlentities'
        114        SEND_VAR                                                 !9
        115        DO_ICALL                                         $68     
        116        ECHO                                                     $68
  161   117        ECHO                                                     '%3C%2FPRE%3E%0A'
  163   118    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.75 ms | 1408 KiB | 29 Q