3v4l.org

run code in 300+ PHP versions simultaneously
<?php class G { public $prefixes = array(); public function test($prefix, $baseDir) { if (!isset($this->prefixes[$prefix])) { $this->prefixes[$prefix] = []; } array_push($this->$prefixes[$prefix], $baseDir); } } $l = new G(); $l->test("a", "b"); var_dump($l);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AlJ1F
function name:  (null)
number of ops:  11
compiled vars:  !0 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'G'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              'a'
          5        SEND_VAL_EX                                              'b'
          6        DO_FCALL                                      0          
   15     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class G:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/AlJ1F
function name:  test
number of ops:  16
compiled vars:  !0 = $prefix, !1 = $baseDir, !2 = $prefixes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_OBJ_IS                                     ~3      'prefixes'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~3, !0
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->9
    8     6    >   FETCH_OBJ_W                                      $6      'prefixes'
          7        ASSIGN_DIM                                               $6, !0
          8        OP_DATA                                                  <array>
   10     9    >   INIT_FCALL                                               'array_push'
         10        FETCH_OBJ_W                                      $8      !2
         11        FETCH_DIM_W                                      $9      $8, !0
         12        SEND_REF                                                 $9
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   11    15      > RETURN                                                   null

End of function test

End of class G.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.24 ms | 1396 KiB | 17 Q