3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Debug Class */ namespace bobcad; class debug { public $runtime_checkpoints; public function __construct() { $this->runtime_checkpoint('Begin Theme Generation'); } public function output() { print_r($_SERVER); } public function runtime_checkpoint($name = '') { $this->runtime_checkpoints[] = array( 'name' => (string) $name, 'time' => microtime(TRUE) ); } public function print_js($html_id) { $checkpoints = $this->runtime_checkpoints; $first = array_shift($checkpoints); $debug_info_array = array($first['name'].': '.$first['time']); $previous_time = $first['time']; foreach ($checkpoints as $checkpoint) { $debug_info_array[] = sprintf( '%1$s: %2$s (+%3$s)', $checkpoint['name'], ($first['time'] - $checkpoint['time']), ($previous_time - $checkpoint['time']) ); $previous_time = $checkpoint['time']; } $debug_info = implode('; ', $debug_info_array); ?> <script type="text/javascript"> document.getElementById("<?php echo $html_id; ?>").setAttribute("title", "<?php echo addslashes($debug_info); ?>"); </script> <?php } public function _on_shutdown() { $this->runtime_checkpoint('Begin Theme Generation'); $this->print_js('copyright'); } } $test = new \bobcad\debug; $test->_on_shutdown();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6lVAY
function name:  (null)
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   NEW                                              $1      'bobcad%5Cdebug'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   56     3        INIT_METHOD_CALL                                         !0, '_on_shutdown'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class bobcad\debug:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6lVAY
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_METHOD_CALL                                         'runtime_checkpoint'
          1        SEND_VAL_EX                                              'Begin+Theme+Generation'
          2        DO_FCALL                                      0          
   13     3      > RETURN                                                   null

End of function __construct

Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6lVAY
function name:  output
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_NS_FCALL_BY_NAME                                    'bobcad%5Cprint_r'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_FUNC_ARG               global              $0      '_SERVER'
          3        SEND_FUNC_ARG                                            $0
          4        DO_FCALL                                      0          
   17     5      > RETURN                                                   null

End of function output

Function runtime_checkpoint:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6lVAY
function name:  runtime_checkpoint
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV_INIT                                        !0      ''
   21     1        CAST                                          6  ~3      !0
          2        INIT_ARRAY                                       ~4      ~3, 'name'
   22     3        INIT_NS_FCALL_BY_NAME                                    'bobcad%5Cmicrotime'
          4        SEND_VAL_EX                                              <true>
          5        DO_FCALL                                      0  $5      
          6        ADD_ARRAY_ELEMENT                                ~4      $5, 'time'
   20     7        FETCH_OBJ_W                                      $1      'runtime_checkpoints'
          8        ASSIGN_DIM                                               $1
   22     9        OP_DATA                                                  ~4
   24    10      > RETURN                                                   null

End of function runtime_checkpoint

Function print_js:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 35
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 35
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/6lVAY
function name:  print_js
number of ops:  50
compiled vars:  !0 = $html_id, !1 = $checkpoints, !2 = $first, !3 = $debug_info_array, !4 = $previous_time, !5 = $checkpoint, !6 = $debug_info
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        FETCH_OBJ_R                                      ~7      'runtime_checkpoints'
          2        ASSIGN                                                   !1, ~7
   28     3        INIT_NS_FCALL_BY_NAME                                    'bobcad%5Carray_shift'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $9      
          6        ASSIGN                                                   !2, $9
   29     7        FETCH_DIM_R                                      ~11     !2, 'name'
          8        CONCAT                                           ~12     ~11, '%3A+'
          9        FETCH_DIM_R                                      ~13     !2, 'time'
         10        CONCAT                                           ~14     ~12, ~13
         11        INIT_ARRAY                                       ~15     ~14
         12        ASSIGN                                                   !3, ~15
   30    13        FETCH_DIM_R                                      ~17     !2, 'time'
         14        ASSIGN                                                   !4, ~17
   31    15      > FE_RESET_R                                       $19     !1, ->35
         16    > > FE_FETCH_R                                               $19, !5, ->35
   32    17    >   INIT_NS_FCALL_BY_NAME                                    'bobcad%5Csprintf'
   33    18        SEND_VAL_EX                                              '%251%24s%3A+%252%24s+%28%2B%253%24s%29'
         19        CHECK_FUNC_ARG                                           
   34    20        FETCH_DIM_FUNC_ARG                               $21     !5, 'name'
         21        SEND_FUNC_ARG                                            $21
   35    22        FETCH_DIM_R                                      ~22     !2, 'time'
         23        FETCH_DIM_R                                      ~23     !5, 'time'
         24        SUB                                              ~24     ~22, ~23
         25        SEND_VAL_EX                                              ~24
   36    26        FETCH_DIM_R                                      ~25     !5, 'time'
         27        SUB                                              ~26     !4, ~25
         28        SEND_VAL_EX                                              ~26
         29        DO_FCALL                                      0  $27     
   32    30        ASSIGN_DIM                                               !3
   36    31        OP_DATA                                                  $27
   38    32        FETCH_DIM_R                                      ~28     !5, 'time'
         33        ASSIGN                                                   !4, ~28
   31    34      > JMP                                                      ->16
         35    >   FE_FREE                                                  $19
   40    36        INIT_NS_FCALL_BY_NAME                                    'bobcad%5Cimplode'
         37        SEND_VAL_EX                                              '%3B+'
         38        SEND_VAR_EX                                              !3
         39        DO_FCALL                                      0  $30     
         40        ASSIGN                                                   !6, $30
   42    41        ECHO                                                     '%09%09%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A%09%09%09document.getElementById%28%22'
   43    42        ECHO                                                     !0
         43        ECHO                                                     '%22%29.setAttribute%28%22title%22%2C+%22'
         44        INIT_NS_FCALL_BY_NAME                                    'bobcad%5Caddslashes'
         45        SEND_VAR_EX                                              !6
         46        DO_FCALL                                      0  $32     
         47        ECHO                                                     $32
         48        ECHO                                                     '%22%29%3B%0A%09%09%3C%2Fscript%3E%0A%09%09'
   46    49      > RETURN                                                   null

End of function print_js

Function _on_shutdown:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6lVAY
function name:  _on_shutdown
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   INIT_METHOD_CALL                                         'runtime_checkpoint'
          1        SEND_VAL_EX                                              'Begin+Theme+Generation'
          2        DO_FCALL                                      0          
   50     3        INIT_METHOD_CALL                                         'print_js'
          4        SEND_VAL_EX                                              'copyright'
          5        DO_FCALL                                      0          
   51     6      > RETURN                                                   null

End of function _on_shutdown

End of class bobcad\debug.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.57 ms | 1404 KiB | 25 Q