3v4l.org

run code in 300+ PHP versions simultaneously
<?php class version_info { private $vi = array(); function __construct() { //$this->vi = array(); } function add($name, $filename) { $this->vi[$filename] = array( 'name' => $name, 'filename' => $filename ); } function dump() { // temporary for debugging foreach ($this->vi as $item) { echo $item['name'] . ' ' . $item['filename'] . "\n"; } } } $sc_version_info = new version_info(); $sc_version_info->add('Test', '/admin/test.php'); f('Test2', '/admin/test2.php'); $sc_version_info->dump(); function f($a, $b) { global $sc_version_info; $sc_version_info->add($a, $b); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MWIhm
function name:  (null)
number of ops:  14
compiled vars:  !0 = $sc_version_info
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'version_info'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'add'
          4        SEND_VAL_EX                                              'Test'
          5        SEND_VAL_EX                                              '%2Fadmin%2Ftest.php'
          6        DO_FCALL                                      0          
   22     7        INIT_FCALL_BY_NAME                                       'f'
          8        SEND_VAL_EX                                              'Test2'
          9        SEND_VAL_EX                                              '%2Fadmin%2Ftest2.php'
         10        DO_FCALL                                      0          
   23    11        INIT_METHOD_CALL                                         !0, 'dump'
         12        DO_FCALL                                      0          
   28    13      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MWIhm
function name:  f
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $sc_version_info
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   26     2        BIND_GLOBAL                                              !2, 'sc_version_info'
   27     3        INIT_METHOD_CALL                                         !2, 'add'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
   28     7      > RETURN                                                   null

End of function f

Class version_info:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MWIhm
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function __construct

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MWIhm
function name:  add
number of ops:  8
compiled vars:  !0 = $name, !1 = $filename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_ARRAY                                       ~4      !0, 'name'
   11     3        ADD_ARRAY_ELEMENT                                ~4      !1, 'filename'
    9     4        FETCH_OBJ_W                                      $2      'vi'
          5        ASSIGN_DIM                                               $2, !1
   11     6        OP_DATA                                                  ~4
   13     7      > RETURN                                                   null

End of function add

Function dump:
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
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/MWIhm
function name:  dump
number of ops:  12
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~1      'vi'
          1      > FE_RESET_R                                       $2      ~1, ->10
          2    > > FE_FETCH_R                                               $2, !0, ->10
   16     3    >   FETCH_DIM_R                                      ~3      !0, 'name'
          4        CONCAT                                           ~4      ~3, '+'
          5        FETCH_DIM_R                                      ~5      !0, 'filename'
          6        CONCAT                                           ~6      ~4, ~5
          7        CONCAT                                           ~7      ~6, '%0A'
          8        ECHO                                                     ~7
   15     9      > JMP                                                      ->2
         10    >   FE_FREE                                                  $2
   18    11      > RETURN                                                   null

End of function dump

End of class version_info.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.01 ms | 1390 KiB | 13 Q