3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); function XMLRPC_response($return_value, $server = NULL){ $data["methodResponse"]["params"]["param"]["value"] = $return_value; $return = XML_serialize($data); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_response', "<p>Received the following data to return:</p>\n\n" . XMLRPC_show($return_value, 'print_r', true)); } header("Connection: close"); header("Content-Length: " . strlen($return)); header("Content-Type: text/xml"); header("Date: " . date("r")); if($server){ header("Server: $server"); } if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_response', "<p>Sent the following response:</p>\n\n" . XMLRPC_show($return, 'print_r', true)); } echo $return; //file_put_contents('xmlrpc.xml', $return); } function XMLRPC_error($faultCode, $faultString, $server = NULL){ $array["methodResponse"]["fault"]["value"]["struct"]["member"] = array(); $temp = &$array["methodResponse"]["fault"]["value"]["struct"]["member"]; $temp[0]["name"] = "faultCode"; $temp[0]["value"]["int"] = $faultCode; $temp[1]["name"] = "faultString"; $temp[1]["value"]["string"] = $faultString; $return = XML_serialize($array); header("Connection: close"); header("Content-Length: " . strlen($return)); header("Content-Type: text/xml"); header("Date: " . date("r")); if($server){ header("Server: $server"); } if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_error', "<p>Sent the following error response:</p>\n\n" . XMLRPC_show($return, 'print_r', true)); } echo $return; } function XMLRPC_convert_timestamp_to_iso8601($timestamp){ #takes a unix timestamp and converts it to iso8601 required by XMLRPC #an example iso8601 datetime is "20010822T03:14:33" return date("Ymd\TH:i:s", $timestamp); } function XMLRPC_convert_iso8601_to_timestamp($iso8601){ return strtotime($iso8601); } function count_numeric_items(&$array){ return is_array($array) ? count(array_filter(array_keys($array), 'is_numeric')) : 0; } function XMLRPC_debug($function_name, $debug_message){ $GLOBALS['XMLRPC_DEBUG_INFO'][] = array($function_name, $debug_message); } function XMLRPC_debug_print(){ if($GLOBALS['XMLRPC_DEBUG_INFO']){ echo "<table border=\"1\" width=\"100%\">\n"; foreach($GLOBALS['XMLRPC_DEBUG_INFO'] as $debug){ echo "<tr><th style=\"vertical-align: top\">$debug[0]</th><td>$debug[1]</td></tr>\n"; } echo "</table>\n"; unset($GLOBALS['XMLRPC_DEBUG_INFO']); }else{ echo "<p>No debugging information available yet.</p>"; } } function XMLRPC_show($data, $func = "print_r", $return_str = false){ ob_start(); $func($data); $output = ob_get_contents(); ob_end_clean(); if($return_str){ return "<pre>" . htmlspecialchars($output) . "</pre>\n"; }else{ echo "<pre>", htmlspecialchars($output), "</pre>\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   90     3      > RETURN                                                   1

Function xmlrpc_response:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 26
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 50
Branch analysis from position: 45
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 65
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
Branch analysis from position: 54
Branch analysis from position: 50
Branch analysis from position: 26
Branch analysis from position: 15
filename:       /in/S5UpI
function name:  XMLRPC_response
number of ops:  67
compiled vars:  !0 = $return_value, !1 = $server, !2 = $data, !3 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    4     2        FETCH_DIM_W                                      $4      !2, 'methodResponse'
          3        FETCH_DIM_W                                      $5      $4, 'params'
          4        FETCH_DIM_W                                      $6      $5, 'param'
          5        ASSIGN_DIM                                               $6, 'value'
          6        OP_DATA                                                  !0
    5     7        INIT_FCALL_BY_NAME                                       'XML_serialize'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !3, $8
    7    11        DEFINED                                          ~10     'XMLRPC_DEBUG'
         12      > JMPZ_EX                                          ~10     ~10, ->15
         13    >   FETCH_CONSTANT                                   ~11     'XMLRPC_DEBUG'
         14        BOOL                                             ~10     ~11
         15    > > JMPZ                                                     ~10, ->26
    8    16    >   INIT_FCALL_BY_NAME                                       'XMLRPC_debug'
         17        SEND_VAL_EX                                              'XMLRPC_response'
         18        INIT_FCALL_BY_NAME                                       'XMLRPC_show'
         19        SEND_VAR_EX                                              !0
         20        SEND_VAL_EX                                              'print_r'
         21        SEND_VAL_EX                                              <true>
         22        DO_FCALL                                      0  $12     
         23        CONCAT                                           ~13     '%3Cp%3EReceived+the+following+data+to+return%3A%3C%2Fp%3E%0A%0A', $12
         24        SEND_VAL_EX                                              ~13
         25        DO_FCALL                                      0          
   11    26    >   INIT_FCALL                                               'header'
         27        SEND_VAL                                                 'Connection%3A+close'
         28        DO_ICALL                                                 
   12    29        INIT_FCALL                                               'header'
         30        STRLEN                                           ~16     !3
         31        CONCAT                                           ~17     'Content-Length%3A+', ~16
         32        SEND_VAL                                                 ~17
         33        DO_ICALL                                                 
   13    34        INIT_FCALL                                               'header'
         35        SEND_VAL                                                 'Content-Type%3A+text%2Fxml'
         36        DO_ICALL                                                 
   14    37        INIT_FCALL                                               'header'
         38        INIT_FCALL                                               'date'
         39        SEND_VAL                                                 'r'
         40        DO_ICALL                                         $20     
         41        CONCAT                                           ~21     'Date%3A+', $20
         42        SEND_VAL                                                 ~21
         43        DO_ICALL                                                 
   15    44      > JMPZ                                                     !1, ->50
   16    45    >   INIT_FCALL                                               'header'
         46        NOP                                                      
         47        FAST_CONCAT                                      ~23     'Server%3A+', !1
         48        SEND_VAL                                                 ~23
         49        DO_ICALL                                                 
   19    50    >   DEFINED                                          ~25     'XMLRPC_DEBUG'
         51      > JMPZ_EX                                          ~25     ~25, ->54
         52    >   FETCH_CONSTANT                                   ~26     'XMLRPC_DEBUG'
         53        BOOL                                             ~25     ~26
         54    > > JMPZ                                                     ~25, ->65
   20    55    >   INIT_FCALL_BY_NAME                                       'XMLRPC_debug'
         56        SEND_VAL_EX                                              'XMLRPC_response'
         57        INIT_FCALL_BY_NAME                                       'XMLRPC_show'
         58        SEND_VAR_EX                                              !3
         59        SEND_VAL_EX                                              'print_r'
         60        SEND_VAL_EX                                              <true>
         61        DO_FCALL                                      0  $27     
         62        CONCAT                                           ~28     '%3Cp%3ESent+the+following+response%3A%3C%2Fp%3E%0A%0A', $27
         63        SEND_VAL_EX                                              ~28
         64        DO_FCALL                                      0          
   22    65    >   ECHO                                                     !3
   24    66      > RETURN                                                   null

End of function xmlrpc_response

Function xmlrpc_error:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 57
Branch analysis from position: 52
2 jumps found. (Code = 46) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 72
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
Branch analysis from position: 61
Branch analysis from position: 57
filename:       /in/S5UpI
function name:  XMLRPC_error
number of ops:  74
compiled vars:  !0 = $faultCode, !1 = $faultString, !2 = $server, !3 = $array, !4 = $temp, !5 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
   27     3        FETCH_DIM_W                                      $6      !3, 'methodResponse'
          4        FETCH_DIM_W                                      $7      $6, 'fault'
          5        FETCH_DIM_W                                      $8      $7, 'value'
          6        FETCH_DIM_W                                      $9      $8, 'struct'
          7        ASSIGN_DIM                                               $9, 'member'
          8        OP_DATA                                                  <array>
   28     9        FETCH_DIM_W                                      $11     !3, 'methodResponse'
         10        FETCH_DIM_W                                      $12     $11, 'fault'
         11        FETCH_DIM_W                                      $13     $12, 'value'
         12        FETCH_DIM_W                                      $14     $13, 'struct'
         13        FETCH_DIM_W                                      $15     $14, 'member'
         14        ASSIGN_REF                                               !4, $15
   29    15        FETCH_DIM_W                                      $17     !4, 0
         16        ASSIGN_DIM                                               $17, 'name'
         17        OP_DATA                                                  'faultCode'
   30    18        FETCH_DIM_W                                      $19     !4, 0
         19        FETCH_DIM_W                                      $20     $19, 'value'
         20        ASSIGN_DIM                                               $20, 'int'
         21        OP_DATA                                                  !0
   31    22        FETCH_DIM_W                                      $22     !4, 1
         23        ASSIGN_DIM                                               $22, 'name'
         24        OP_DATA                                                  'faultString'
   32    25        FETCH_DIM_W                                      $24     !4, 1
         26        FETCH_DIM_W                                      $25     $24, 'value'
         27        ASSIGN_DIM                                               $25, 'string'
         28        OP_DATA                                                  !1
   34    29        INIT_FCALL_BY_NAME                                       'XML_serialize'
         30        SEND_VAR_EX                                              !3
         31        DO_FCALL                                      0  $27     
         32        ASSIGN                                                   !5, $27
   36    33        INIT_FCALL                                               'header'
         34        SEND_VAL                                                 'Connection%3A+close'
         35        DO_ICALL                                                 
   37    36        INIT_FCALL                                               'header'
         37        STRLEN                                           ~30     !5
         38        CONCAT                                           ~31     'Content-Length%3A+', ~30
         39        SEND_VAL                                                 ~31
         40        DO_ICALL                                                 
   38    41        INIT_FCALL                                               'header'
         42        SEND_VAL                                                 'Content-Type%3A+text%2Fxml'
         43        DO_ICALL                                                 
   39    44        INIT_FCALL                                               'header'
         45        INIT_FCALL                                               'date'
         46        SEND_VAL                                                 'r'
         47        DO_ICALL                                         $34     
         48        CONCAT                                           ~35     'Date%3A+', $34
         49        SEND_VAL                                                 ~35
         50        DO_ICALL                                                 
   40    51      > JMPZ                                                     !2, ->57
   41    52    >   INIT_FCALL                                               'header'
         53        NOP                                                      
         54        FAST_CONCAT                                      ~37     'Server%3A+', !2
         55        SEND_VAL                                                 ~37
         56        DO_ICALL                                                 
   43    57    >   DEFINED                                          ~39     'XMLRPC_DEBUG'
         58      > JMPZ_EX                                          ~39     ~39, ->61
         59    >   FETCH_CONSTANT                                   ~40     'XMLRPC_DEBUG'
         60        BOOL                                             ~39     ~40
         61    > > JMPZ                                                     ~39, ->72
   44    62    >   INIT_FCALL_BY_NAME                                       'XMLRPC_debug'
         63        SEND_VAL_EX                                              'XMLRPC_error'
         64        INIT_FCALL_BY_NAME                                       'XMLRPC_show'
         65        SEND_VAR_EX                                              !5
         66        SEND_VAL_EX                                              'print_r'
         67        SEND_VAL_EX                                              <true>
         68        DO_FCALL                                      0  $41     
         69        CONCAT                                           ~42     '%3Cp%3ESent+the+following+error+response%3A%3C%2Fp%3E%0A%0A', $41
         70        SEND_VAL_EX                                              ~42
         71        DO_FCALL                                      0          
   46    72    >   ECHO                                                     !5
   47    73      > RETURN                                                   null

End of function xmlrpc_error

Function xmlrpc_convert_timestamp_to_iso8601:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  XMLRPC_convert_timestamp_to_iso8601
number of ops:  7
compiled vars:  !0 = $timestamp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV                                             !0      
   52     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Ymd%5CTH%3Ai%3As'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   53     6*     > RETURN                                                   null

End of function xmlrpc_convert_timestamp_to_iso8601

Function xmlrpc_convert_iso8601_to_timestamp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  XMLRPC_convert_iso8601_to_timestamp
number of ops:  6
compiled vars:  !0 = $iso8601
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   56     1        INIT_FCALL                                               'strtotime'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   57     5*     > RETURN                                                   null

End of function xmlrpc_convert_iso8601_to_timestamp

Function count_numeric_items:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  count_numeric_items
number of ops:  16
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
   60     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~1, ->13
          3    >   INIT_FCALL                                               'array_filter'
          4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        SEND_VAL                                                 'is_numeric'
          9        DO_ICALL                                         $3      
         10        COUNT                                            ~4      $3
         11        QM_ASSIGN                                        ~5      ~4
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~5      0
         14    > > RETURN                                                   ~5
   61    15*     > RETURN                                                   null

End of function count_numeric_items

Function xmlrpc_debug:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  XMLRPC_debug
number of ops:  9
compiled vars:  !0 = $function_name, !1 = $debug_message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   64     2        INIT_ARRAY                                       ~5      !0
          3        ADD_ARRAY_ELEMENT                                ~5      !1
          4        FETCH_W                      global              $2      'GLOBALS'
          5        FETCH_DIM_W                                      $3      $2, 'XMLRPC_DEBUG_INFO'
          6        ASSIGN_DIM                                               $3
          7        OP_DATA                                                  ~5
   65     8      > RETURN                                                   null

End of function xmlrpc_debug

Function xmlrpc_debug_print:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  XMLRPC_debug_print
number of ops:  24
compiled vars:  !0 = $debug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   FETCH_R                      global              ~1      'GLOBALS'
          1        FETCH_DIM_R                                      ~2      ~1, 'XMLRPC_DEBUG_INFO'
          2      > JMPZ                                                     ~2, ->22
   69     3    >   ECHO                                                     '%3Ctable+border%3D%221%22+width%3D%22100%25%22%3E%0A'
   70     4        FETCH_R                      global              ~3      'GLOBALS'
          5        FETCH_DIM_R                                      ~4      ~3, 'XMLRPC_DEBUG_INFO'
          6      > FE_RESET_R                                       $5      ~4, ->17
          7    > > FE_FETCH_R                                               $5, !0, ->17
   71     8    >   ROPE_INIT                                     5  ~9      '%3Ctr%3E%3Cth+style%3D%22vertical-align%3A+top%22%3E'
          9        FETCH_DIM_R                                      ~6      !0, 0
         10        ROPE_ADD                                      1  ~9      ~9, ~6
         11        ROPE_ADD                                      2  ~9      ~9, '%3C%2Fth%3E%3Ctd%3E'
         12        FETCH_DIM_R                                      ~7      !0, 1
         13        ROPE_ADD                                      3  ~9      ~9, ~7
         14        ROPE_END                                      4  ~8      ~9, '%3C%2Ftd%3E%3C%2Ftr%3E%0A'
         15        ECHO                                                     ~8
   70    16      > JMP                                                      ->7
         17    >   FE_FREE                                                  $5
   73    18        ECHO                                                     '%3C%2Ftable%3E%0A'
   74    19        FETCH_UNSET                                      $12     'GLOBALS'
         20        UNSET_DIM                                                $12, 'XMLRPC_DEBUG_INFO'
         21      > JMP                                                      ->23
   76    22    >   ECHO                                                     '%3Cp%3ENo+debugging+information+available+yet.%3C%2Fp%3E'
   78    23    > > RETURN                                                   null

End of function xmlrpc_debug_print

Function xmlrpc_show:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5UpI
function name:  XMLRPC_show
number of ops:  28
compiled vars:  !0 = $data, !1 = $func, !2 = $return_str, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   80     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'print_r'
          2        RECV_INIT                                        !2      <false>
   81     3        INIT_FCALL                                               'ob_start'
          4        DO_ICALL                                                 
   82     5        INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   83     8        INIT_FCALL                                               'ob_get_contents'
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !3, $6
   84    11        INIT_FCALL                                               'ob_end_clean'
         12        DO_ICALL                                                 
   85    13      > JMPZ                                                     !2, ->21
   86    14    >   INIT_FCALL                                               'htmlspecialchars'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $9      
         17        CONCAT                                           ~10     '%3Cpre%3E', $9
         18        CONCAT                                           ~11     ~10, '%3C%2Fpre%3E%0A'
         19      > RETURN                                                   ~11
         20*       JMP                                                      ->27
   88    21    >   ECHO                                                     '%3Cpre%3E'
         22        INIT_FCALL                                               'htmlspecialchars'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $12     
         25        ECHO                                                     $12
         26        ECHO                                                     '%3C%2Fpre%3E%0A'
   90    27      > RETURN                                                   null

End of function xmlrpc_show

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.17 ms | 1420 KiB | 33 Q