3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TypechoXMLRPC { public $XMLRPC_URL; public $UserName; public $PassWord; public function __constructor($XMLRPC_URL, $UserName, $PassWord) { $this->XMLRPC_URL = $XMLRPC_URL; $this->UserName = $UserName; $this->PassWord = $PassWord; } public function request($requestname, $params) { $request = xmlrpc_encode_request($requestname, $params); $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_URL, $this->XMLRPC_URL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 1); $results = curl_exec($ch); curl_close($ch); return $results; } public function getUsersBlogs() { return $this->request("wp.getUsersBlogs", array($this->UserName, $this->PassWord)); } } $xmlrpc = new TypechoXMLRPC("http://imnerd.org/action/xmlrpc", "admin", "test"); echo $xmlrpc->XMLRPC_URL; $pages = $xmlrpc->getUsersBlogs();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/go2tL
function name:  (null)
number of ops:  12
compiled vars:  !0 = $xmlrpc, !1 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'TypechoXMLRPC'
          1        SEND_VAL_EX                                              'http%3A%2F%2Fimnerd.org%2Faction%2Fxmlrpc'
          2        SEND_VAL_EX                                              'admin'
          3        SEND_VAL_EX                                              'test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   31     6        FETCH_OBJ_R                                      ~5      !0, 'XMLRPC_URL'
          7        ECHO                                                     ~5
   32     8        INIT_METHOD_CALL                                         !0, 'getUsersBlogs'
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !1, $6
         11      > RETURN                                                   1

Class TypechoXMLRPC:
Function __constructor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/go2tL
function name:  __constructor
number of ops:  10
compiled vars:  !0 = $XMLRPC_URL, !1 = $UserName, !2 = $PassWord
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN_OBJ                                               'XMLRPC_URL'
          4        OP_DATA                                                  !0
   10     5        ASSIGN_OBJ                                               'UserName'
          6        OP_DATA                                                  !1
   11     7        ASSIGN_OBJ                                               'PassWord'
          8        OP_DATA                                                  !2
   12     9      > RETURN                                                   null

End of function __constructor

Function request:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/go2tL
function name:  request
number of ops:  45
compiled vars:  !0 = $requestname, !1 = $params, !2 = $request, !3 = $ch, !4 = $results
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        INIT_FCALL_BY_NAME                                       'xmlrpc_encode_request'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   16     7        INIT_FCALL_BY_NAME                                       'curl_init'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !3, $7
   17    10        INIT_FCALL_BY_NAME                                       'curl_setopt'
         11        SEND_VAR_EX                                              !3
         12        FETCH_CONSTANT                                   ~9      'CURLOPT_POSTFIELDS'
         13        SEND_VAL_EX                                              ~9
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0          
   18    16        INIT_FCALL_BY_NAME                                       'curl_setopt'
         17        SEND_VAR_EX                                              !3
         18        FETCH_CONSTANT                                   ~11     'CURLOPT_URL'
         19        SEND_VAL_EX                                              ~11
         20        CHECK_FUNC_ARG                                           
         21        FETCH_OBJ_FUNC_ARG                               $12     'XMLRPC_URL'
         22        SEND_FUNC_ARG                                            $12
         23        DO_FCALL                                      0          
   19    24        INIT_FCALL_BY_NAME                                       'curl_setopt'
         25        SEND_VAR_EX                                              !3
         26        FETCH_CONSTANT                                   ~14     'CURLOPT_RETURNTRANSFER'
         27        SEND_VAL_EX                                              ~14
         28        SEND_VAL_EX                                              1
         29        DO_FCALL                                      0          
   20    30        INIT_FCALL_BY_NAME                                       'curl_setopt'
         31        SEND_VAR_EX                                              !3
         32        FETCH_CONSTANT                                   ~16     'CURLOPT_TIMEOUT'
         33        SEND_VAL_EX                                              ~16
         34        SEND_VAL_EX                                              1
         35        DO_FCALL                                      0          
   21    36        INIT_FCALL_BY_NAME                                       'curl_exec'
         37        SEND_VAR_EX                                              !3
         38        DO_FCALL                                      0  $18     
         39        ASSIGN                                                   !4, $18
   22    40        INIT_FCALL_BY_NAME                                       'curl_close'
         41        SEND_VAR_EX                                              !3
         42        DO_FCALL                                      0          
   23    43      > RETURN                                                   !4
   24    44*     > RETURN                                                   null

End of function request

Function getusersblogs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/go2tL
function name:  getUsersBlogs
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_METHOD_CALL                                         'request'
          1        SEND_VAL_EX                                              'wp.getUsersBlogs'
          2        FETCH_OBJ_R                                      ~0      'UserName'
          3        INIT_ARRAY                                       ~1      ~0
          4        FETCH_OBJ_R                                      ~2      'PassWord'
          5        ADD_ARRAY_ELEMENT                                ~1      ~2
          6        SEND_VAL_EX                                              ~1
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   28     9*     > RETURN                                                   null

End of function getusersblogs

End of class TypechoXMLRPC.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.76 ms | 1403 KiB | 13 Q