3v4l.org

run code in 300+ PHP versions simultaneously
<?php # initialize JSON-RPC client $api_key = '161ff5c48a60fdda9bd31da09e0c4224'; //Place API key here $api_url = 'http://api2.getresponse.com'; $client = new jsonRPCClient($api_url); try { $name = array(); $result = $client->get_campaigns($api_key); //Get Campaigns name and id. foreach($result as $r){ $name = $r['name']; print "List Name --> " . $name; echo '&nbsp'; echo '&nbsp'; echo '&nbsp'; echo '&nbsp'; echo '&nbsp'; echo '&nbsp'; echo '&nbsp'; echo '&nbsp'; $result2 = $client->get_campaigns( $api_key, array ( 'name' => array ( 'EQUALS' => $name ) ) ); $res = array_keys($result2); $CAMPAIGN_IDs = array_pop($res); print "List ID --> " . $CAMPAIGN_IDs; echo "<br>"; } } catch (Exception $e) { echo $e->getMessage(); } ?> <?php /** * jsonRPCClient.php * * Written using the JSON RPC specification - * http://json-rpc.org/wiki/specification * */ class jsonRPCClient { protected $url = null, $is_notification = false, $is_debug = false; // http errors - more can be found at // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes public $http_errors = array ( 400 => '400 Bad Request', 500 => '500 Internal Server Error' ); /** * Takes the connection parameter and checks for extentions * * @param string $url - url name like http://example.com/ * @return void */ public function __construct( $url ) { $validateParams = array ( false === extension_loaded('curl') => 'The curl extension must be loaded for using this class !', false === extension_loaded('json') => 'The json extension must be loaded for using this class !' ); $this->checkForErrors( $validateParams ); // set an url to connect to $this->url = $url; } /** * Set debug mode * * @param boolean $is_debug * @return void */ public function setDebug( $is_debug ) { $this->is_debug = !empty($is_debug); } /** * Set request to be a notification * * @param boolean $is_notification * @return void */ public function setNotification( $is_notification ) { $this->is_is_notification = !empty($is_notification); } /** * Performs a request and gets the results * * @param string $method - A String containing the name of the method to be invoked. * @param array $params - An Array of objects to pass as arguments to the method. * @return array */ public function __call( $method, $params ) { static $counter; // check if given params are correct $validateParams = array ( false === is_scalar($method) => 'Method name has no scalar value', false === is_array($params) => 'Params must be given as array' ); $this->checkForErrors( $validateParams ); // if this is_notification - JSON-RPC specification point 1.3 $requestId = true === $this->is_notification ? null : ++$counter; // Request (method invocation) - JSON-RPC specification point 1.1 $request = json_encode( array ( 'method' => $method, 'params' => array_values($params), 'id' => $requestId ) ); // if is_debug mode is true then add request to is_debug $this->debug( 'Request: ' . $request . "\r\n", false ); $response = $this->getResponse( $request ); // if is_debug mode is true then add response to is_debug and display it $this->debug( 'Response: ' . $response . "\r\n", true ); // decode and create array ( can be object, just set to false ) $response = json_decode( utf8_encode($response), true ); // if this was just is_notification if ( true === $this->is_notification ) { return true; } // check if response is correct $validateParams = array ( !is_null($response['error']) => 'Request have return error: ' . $response['error'], $response['id'] != $requestId => 'Request id: '.$requestId.'is different from Response id: ' . $response['id'], ); $this->checkForErrors( $validateParams ); return $response['result']; } /** * When the method invocation completes, the service must reply with a response. * The response is a single object serialized using JSON * * @param string $request * @return string */ protected function & getResponse( & $request ) { // do the actual connection $ch = curl_init(); // set URL curl_setopt($ch, CURLOPT_URL, $this->url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_HEADER, 'Content-type: application/json;'); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // send the request $response = curl_exec($ch); // check http status code $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ( isset($this->http_errors[$http_code]) ) { throw new Exception('Response Http Error - ' . $this->http_errors[$http_code] ); } // check for curl error if ( 0 < curl_errno($ch) ) { throw new Exception('Unable to connect to '.$this->url . ' Error: ' . curl_error($ch) ); } // close the connection curl_close($ch); return $response; } /** * Check for errors * * @param array $validateArray * @return void */ protected function checkForErrors( & $validateArray ) { foreach ( $validateArray as $test => $error ) { if ( $test ) { throw new Exception( $error ); } } } /** * For is_debug and performance stats * * @param string $add * @param boolean $show * @return void */ protected function debug( $add, $show = false ) { static $debug, $startTime; // is_debug off return if ( false === $this->is_debug ) { return; } // add $debug .= $add; // get starttime $startTime = empty($startTime) ? array_sum(explode(' ', microtime())) : $startTime; if ( true === $show and !empty($debug) ) { // get endtime $endTime = array_sum(explode(' ', microtime())); // performance summary $debug .= 'Request time: ' . round($endTime - $startTime, 3) . ' s Memory usage: ' . round(memory_get_usage() / 1024) . " kb\r\n"; echo nl2br($debug); // send output imidiately flush(); // clean static $debug = $startTime = null; } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 44
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 44
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Found catch point at position: 46
Branch analysis from position: 46
2 jumps found. (Code = 107) Position 1 = 47, Position 2 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpb9m
function name:  (null)
number of ops:  52
compiled vars:  !0 = $api_key, !1 = $api_url, !2 = $client, !3 = $name, !4 = $result, !5 = $r, !6 = $result2, !7 = $res, !8 = $CAMPAIGN_IDs, !9 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '161ff5c48a60fdda9bd31da09e0c4224'
    5     1        ASSIGN                                                   !1, 'http%3A%2F%2Fapi2.getresponse.com'
    6     2        NEW                                              $12     'jsonRPCClient'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $12
   10     6        ASSIGN                                                   !3, <array>
   11     7        INIT_METHOD_CALL                                         !2, 'get_campaigns'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $16     
         10        ASSIGN                                                   !4, $16
   14    11      > FE_RESET_R                                       $18     !4, ->44
         12    > > FE_FETCH_R                                               $18, !5, ->44
   15    13    >   FETCH_DIM_R                                      ~19     !5, 'name'
         14        ASSIGN                                                   !3, ~19
   16    15        CONCAT                                           ~21     'List+Name+--%3E+', !3
         16        ECHO                                                     ~21
         17        ECHO                                                     '%26nbsp'
         18        ECHO                                                     '%26nbsp'
         19        ECHO                                                     '%26nbsp'
         20        ECHO                                                     '%26nbsp'
         21        ECHO                                                     '%26nbsp'
         22        ECHO                                                     '%26nbsp'
         23        ECHO                                                     '%26nbsp'
         24        ECHO                                                     '%26nbsp'
   17    25        INIT_METHOD_CALL                                         !2, 'get_campaigns'
   18    26        SEND_VAR_EX                                              !0
   20    27        INIT_ARRAY                                       ~22     !3, 'EQUALS'
         28        INIT_ARRAY                                       ~23     ~22, 'name'
         29        SEND_VAL_EX                                              ~23
         30        DO_FCALL                                      0  $24     
   17    31        ASSIGN                                                   !6, $24
   23    32        INIT_FCALL                                               'array_keys'
         33        SEND_VAR                                                 !6
         34        DO_ICALL                                         $26     
         35        ASSIGN                                                   !7, $26
   24    36        INIT_FCALL                                               'array_pop'
         37        SEND_REF                                                 !7
         38        DO_ICALL                                         $28     
         39        ASSIGN                                                   !8, $28
   25    40        CONCAT                                           ~30     'List+ID+--%3E+', !8
         41        ECHO                                                     ~30
   26    42        ECHO                                                     '%3Cbr%3E'
   14    43      > JMP                                                      ->12
         44    >   FE_FREE                                                  $18
         45      > JMP                                                      ->50
   29    46  E > > CATCH                                       last         'Exception'
   30    47    >   INIT_METHOD_CALL                                         !9, 'getMessage'
         48        DO_FCALL                                      0  $31     
         49        ECHO                                                     $31
   33    50    >   ECHO                                                     '%0A%0A'
  238    51      > RETURN                                                   1

Class jsonRPCClient:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpb9m
function name:  __construct
number of ops:  18
compiled vars:  !0 = $url, !1 = $validateParams
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   RECV                                             !0      
   66     1        INIT_FCALL                                               'extension_loaded'
          2        SEND_VAL                                                 'curl'
          3        DO_ICALL                                         $2      
          4        TYPE_CHECK                                    4  ~3      $2
          5        INIT_ARRAY                                       ~4      'The+curl+extension+must+be+loaded+for+using+this+class+%21', ~3
   67     6        INIT_FCALL                                               'extension_loaded'
          7        SEND_VAL                                                 'json'
          8        DO_ICALL                                         $5      
          9        TYPE_CHECK                                    4  ~6      $5
         10        ADD_ARRAY_ELEMENT                                ~4      'The+json+extension+must+be+loaded+for+using+this+class+%21', ~6
   64    11        ASSIGN                                                   !1, ~4
   69    12        INIT_METHOD_CALL                                         'checkForErrors'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
   72    15        ASSIGN_OBJ                                               'url'
         16        OP_DATA                                                  !0
   73    17      > RETURN                                                   null

End of function __construct

Function setdebug:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpb9m
function name:  setDebug
number of ops:  6
compiled vars:  !0 = $is_debug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   81     0  E >   RECV                                             !0      
   83     1        ISSET_ISEMPTY_CV                                 ~2      !0
          2        BOOL_NOT                                         ~3      ~2
          3        ASSIGN_OBJ                                               'is_debug'
          4        OP_DATA                                                  ~3
   84     5      > RETURN                                                   null

End of function setdebug

Function setnotification:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cpb9m
function name:  setNotification
number of ops:  6
compiled vars:  !0 = $is_notification
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   92     0  E >   RECV                                             !0      
   94     1        ISSET_ISEMPTY_CV                                 ~2      !0
          2        BOOL_NOT                                         ~3      ~2
          3        ASSIGN_OBJ                                               'is_is_notification'
          4        OP_DATA                                                  ~3
   95     5      > RETURN                                                   null

End of function setnotification

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 59
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 59
Branch analysis from position: 58
Branch analysis from position: 59
filename:       /in/cpb9m
function name:  __call
number of ops:  79
compiled vars:  !0 = $method, !1 = $params, !2 = $counter, !3 = $validateParams, !4 = $requestId, !5 = $request, !6 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  104     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  106     2        BIND_STATIC                                              !2
  111     3        TYPE_CHECK                                  124  ~7      !0
          4        TYPE_CHECK                                    4  ~8      ~7
          5        INIT_ARRAY                                       ~9      'Method+name+has+no+scalar+value', ~8
  112     6        TYPE_CHECK                                  128  ~10     !1
          7        TYPE_CHECK                                    4  ~11     ~10
          8        ADD_ARRAY_ELEMENT                                ~9      'Params+must+be+given+as+array', ~11
  109     9        ASSIGN                                                   !3, ~9
  114    10        INIT_METHOD_CALL                                         'checkForErrors'
         11        SEND_VAR_EX                                              !3
         12        DO_FCALL                                      0          
  117    13        FETCH_OBJ_R                                      ~14     'is_notification'
         14        TYPE_CHECK                                    8          ~14
         15      > JMPZ                                                     ~15, ->18
         16    >   QM_ASSIGN                                        ~16     null
         17      > JMP                                                      ->20
         18    >   PRE_INC                                          ~17     !2
         19        QM_ASSIGN                                        ~16     ~17
         20    >   ASSIGN                                                   !4, ~16
  120    21        INIT_FCALL                                               'json_encode'
         22        INIT_ARRAY                                       ~19     !0, 'method'
         23        INIT_FCALL                                               'array_values'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $20     
         26        ADD_ARRAY_ELEMENT                                ~19     $20, 'params'
         27        ADD_ARRAY_ELEMENT                                ~19     !4, 'id'
         28        SEND_VAL                                                 ~19
         29        DO_ICALL                                         $21     
         30        ASSIGN                                                   !5, $21
  123    31        INIT_METHOD_CALL                                         'debug'
         32        CONCAT                                           ~23     'Request%3A+', !5
         33        CONCAT                                           ~24     ~23, '%0D%0A'
         34        SEND_VAL_EX                                              ~24
         35        SEND_VAL_EX                                              <false>
         36        DO_FCALL                                      0          
  125    37        INIT_METHOD_CALL                                         'getResponse'
         38        SEND_VAR_EX                                              !5
         39        DO_FCALL                                      0  $26     
         40        ASSIGN                                                   !6, $26
  128    41        INIT_METHOD_CALL                                         'debug'
         42        CONCAT                                           ~28     'Response%3A+', !6
         43        CONCAT                                           ~29     ~28, '%0D%0A'
         44        SEND_VAL_EX                                              ~29
         45        SEND_VAL_EX                                              <true>
         46        DO_FCALL                                      0          
  131    47        INIT_FCALL                                               'json_decode'
         48        INIT_FCALL                                               'utf8_encode'
         49        SEND_VAR                                                 !6
         50        DO_ICALL                                         $31     
         51        SEND_VAR                                                 $31
         52        SEND_VAL                                                 <true>
         53        DO_ICALL                                         $32     
         54        ASSIGN                                                   !6, $32
  134    55        FETCH_OBJ_R                                      ~34     'is_notification'
         56        TYPE_CHECK                                    8          ~34
         57      > JMPZ                                                     ~35, ->59
  136    58    > > RETURN                                                   <true>
  142    59    >   FETCH_DIM_R                                      ~36     !6, 'error'
         60        TYPE_CHECK                                    2  ~37     ~36
         61        BOOL_NOT                                         ~38     ~37
         62        FETCH_DIM_R                                      ~39     !6, 'error'
         63        CONCAT                                           ~40     'Request+have+return+error%3A+', ~39
         64        INIT_ARRAY                                       ~41     ~40, ~38
  143    65        FETCH_DIM_R                                      ~42     !6, 'id'
         66        IS_NOT_EQUAL                                     ~43     !4, ~42
         67        CONCAT                                           ~44     'Request+id%3A+', !4
         68        CONCAT                                           ~45     ~44, 'is+different+from+Response+id%3A+'
         69        FETCH_DIM_R                                      ~46     !6, 'id'
         70        CONCAT                                           ~47     ~45, ~46
         71        ADD_ARRAY_ELEMENT                                ~41     ~47, ~43
  140    72        ASSIGN                                                   !3, ~41
  146    73        INIT_METHOD_CALL                                         'checkForErrors'
         74        SEND_VAR_EX                                              !3
         75        DO_FCALL                                      0          
  148    76        FETCH_DIM_R                                      ~50     !6, 'result'
         77      > RETURN                                                   ~50
  149    78*     > RETURN                                                   null

End of function __call

Function getresponse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 68
Branch analysis from position: 61
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 84
Branch analysis from position: 73
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 84
Return found
filename:       /in/cpb9m
function name:  getResponse
number of ops:  89
compiled vars:  !0 = $request, !1 = $ch, !2 = $response, !3 = $http_code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  158     0  E >   RECV                                             !0      
  161     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                                   !1, $4
  163     4        INIT_FCALL_BY_NAME                                       'curl_setopt'
          5        SEND_VAR_EX                                              !1
          6        FETCH_CONSTANT                                   ~6      'CURLOPT_URL'
          7        SEND_VAL_EX                                              ~6
          8        CHECK_FUNC_ARG                                           
          9        FETCH_OBJ_FUNC_ARG                               $7      'url'
         10        SEND_FUNC_ARG                                            $7
         11        DO_FCALL                                      0          
  164    12        INIT_FCALL_BY_NAME                                       'curl_setopt'
         13        SEND_VAR_EX                                              !1
         14        FETCH_CONSTANT                                   ~9      'CURLOPT_POST'
         15        SEND_VAL_EX                                              ~9
         16        SEND_VAL_EX                                              1
         17        DO_FCALL                                      0          
  165    18        INIT_FCALL_BY_NAME                                       'curl_setopt'
         19        SEND_VAR_EX                                              !1
         20        FETCH_CONSTANT                                   ~11     'CURLOPT_POSTFIELDS'
         21        SEND_VAL_EX                                              ~11
         22        SEND_VAR_EX                                              !0
         23        DO_FCALL                                      0          
  166    24        INIT_FCALL_BY_NAME                                       'curl_setopt'
         25        SEND_VAR_EX                                              !1
         26        FETCH_CONSTANT                                   ~13     'CURLOPT_HEADER'
         27        SEND_VAL_EX                                              ~13
         28        SEND_VAL_EX                                              'Content-type%3A+application%2Fjson%3B'
         29        DO_FCALL                                      0          
  167    30        INIT_FCALL_BY_NAME                                       'curl_setopt'
         31        SEND_VAR_EX                                              !1
         32        FETCH_CONSTANT                                   ~15     'CURLOPT_ENCODING'
         33        SEND_VAL_EX                                              ~15
         34        SEND_VAL_EX                                              'gzip%2Cdeflate'
         35        DO_FCALL                                      0          
  168    36        INIT_FCALL_BY_NAME                                       'curl_setopt'
         37        SEND_VAR_EX                                              !1
         38        FETCH_CONSTANT                                   ~17     'CURLOPT_RETURNTRANSFER'
         39        SEND_VAL_EX                                              ~17
         40        SEND_VAL_EX                                              1
         41        DO_FCALL                                      0          
  169    42        INIT_FCALL_BY_NAME                                       'curl_setopt'
         43        SEND_VAR_EX                                              !1
         44        FETCH_CONSTANT                                   ~19     'CURLOPT_FOLLOWLOCATION'
         45        SEND_VAL_EX                                              ~19
         46        SEND_VAL_EX                                              1
         47        DO_FCALL                                      0          
  171    48        INIT_FCALL_BY_NAME                                       'curl_exec'
         49        SEND_VAR_EX                                              !1
         50        DO_FCALL                                      0  $21     
         51        ASSIGN                                                   !2, $21
  173    52        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         53        SEND_VAR_EX                                              !1
         54        FETCH_CONSTANT                                   ~23     'CURLINFO_HTTP_CODE'
         55        SEND_VAL_EX                                              ~23
         56        DO_FCALL                                      0  $24     
         57        ASSIGN                                                   !3, $24
  174    58        FETCH_OBJ_IS                                     ~26     'http_errors'
         59        ISSET_ISEMPTY_DIM_OBJ                         0          ~26, !3
         60      > JMPZ                                                     ~27, ->68
  176    61    >   NEW                                              $28     'Exception'
         62        FETCH_OBJ_R                                      ~29     'http_errors'
         63        FETCH_DIM_R                                      ~30     ~29, !3
         64        CONCAT                                           ~31     'Response+Http+Error+-+', ~30
         65        SEND_VAL_EX                                              ~31
         66        DO_FCALL                                      0          
         67      > THROW                                         0          $28
  179    68    >   INIT_FCALL_BY_NAME                                       'curl_errno'
         69        SEND_VAR_EX                                              !1
         70        DO_FCALL                                      0  $33     
         71        IS_SMALLER                                               0, $33
         72      > JMPZ                                                     ~34, ->84
  181    73    >   NEW                                              $35     'Exception'
         74        FETCH_OBJ_R                                      ~36     'url'
         75        CONCAT                                           ~37     'Unable+to+connect+to+', ~36
         76        CONCAT                                           ~38     ~37, '+Error%3A+'
         77        INIT_FCALL_BY_NAME                                       'curl_error'
         78        SEND_VAR_EX                                              !1
         79        DO_FCALL                                      0  $39     
         80        CONCAT                                           ~40     ~38, $39
         81        SEND_VAL_EX                                              ~40
         82        DO_FCALL                                      0          
         83      > THROW                                         0          $35
  184    84    >   INIT_FCALL_BY_NAME                                       'curl_close'
         85        SEND_VAR_EX                                              !1
         86        DO_FCALL                                      0          
  185    87      > RETURN_BY_REF                                            !2
  186    88*     > RETURN_BY_REF                                            null

End of function getresponse

Function checkforerrors:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/cpb9m
function name:  checkForErrors
number of ops:  12
compiled vars:  !0 = $validateArray, !1 = $error, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  194     0  E >   RECV                                             !0      
  196     1      > FE_RESET_R                                       $3      !0, ->10
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->10
          3    >   ASSIGN                                                   !2, ~4
  198     4      > JMPZ                                                     !2, ->9
  200     5    >   NEW                                              $6      'Exception'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $6
  196     9    > > JMP                                                      ->2
         10    >   FE_FREE                                                  $3
  203    11      > RETURN                                                   null

End of function checkforerrors

Function debug:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 29
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 64
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
Branch analysis from position: 29
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 29
Branch analysis from position: 26
Branch analysis from position: 29
filename:       /in/cpb9m
function name:  debug
number of ops:  65
compiled vars:  !0 = $add, !1 = $show, !2 = $debug, !3 = $startTime, !4 = $endTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  212     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
  214     2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
  216     4        FETCH_OBJ_R                                      ~5      'is_debug'
          5        TYPE_CHECK                                    4          ~5
          6      > JMPZ                                                     ~6, ->8
  218     7    > > RETURN                                                   null
  221     8    >   ASSIGN_OP                                     8          !2, !0
  223     9        ISSET_ISEMPTY_CV                                         !3
         10      > JMPZ                                                     ~8, ->22
         11    >   INIT_FCALL                                               'array_sum'
         12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '+'
         14        INIT_FCALL                                               'microtime'
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                         $11     
         20        QM_ASSIGN                                        ~12     $11
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~12     !3
         23    >   ASSIGN                                                   !3, ~12
  224    24        TYPE_CHECK                                    8  ~14     !1
         25      > JMPZ_EX                                          ~14     ~14, ->29
         26    >   ISSET_ISEMPTY_CV                                 ~15     !2
         27        BOOL_NOT                                         ~16     ~15
         28        BOOL                                             ~14     ~16
         29    > > JMPZ                                                     ~14, ->64
  227    30    >   INIT_FCALL                                               'array_sum'
         31        INIT_FCALL                                               'explode'
         32        SEND_VAL                                                 '+'
         33        INIT_FCALL                                               'microtime'
         34        DO_ICALL                                         $17     
         35        SEND_VAR                                                 $17
         36        DO_ICALL                                         $18     
         37        SEND_VAR                                                 $18
         38        DO_ICALL                                         $19     
         39        ASSIGN                                                   !4, $19
  229    40        INIT_FCALL                                               'round'
         41        SUB                                              ~21     !4, !3
         42        SEND_VAL                                                 ~21
         43        SEND_VAL                                                 3
         44        DO_ICALL                                         $22     
         45        CONCAT                                           ~23     'Request+time%3A+', $22
         46        CONCAT                                           ~24     ~23, '+s+Memory+usage%3A+'
         47        INIT_FCALL                                               'round'
         48        INIT_FCALL                                               'memory_get_usage'
         49        DO_ICALL                                         $25     
         50        DIV                                              ~26     $25, 1024
         51

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.41 ms | 1428 KiB | 37 Q