3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $titleInfo = []; /** @return array */ public function bar() { $key = ''; if ( !isset( $this->titleInfo[$key] ) ) { $this->titleInfo[$key] = [ 42 ]; } return $this->titleInfo[$key]; # The critical line } } $value = ( new Foo )->bar(); var_dump( $value );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vKJaS
function name:  (null)
number of ops:  9
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'bar'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   16     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/vKJaS
function name:  bar
number of ops:  12
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, ''
    8     1        FETCH_OBJ_IS                                     ~2      'titleInfo'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~2, !0
          3        BOOL_NOT                                         ~4      ~3
          4      > JMPZ                                                     ~4, ->8
    9     5    >   FETCH_OBJ_W                                      $5      'titleInfo'
          6        ASSIGN_DIM                                               $5, !0
          7        OP_DATA                                                  <array>
   11     8    >   FETCH_OBJ_R                                      ~7      'titleInfo'
          9        FETCH_DIM_R                                      ~8      ~7, !0
         10      > RETURN                                                   ~8
   12    11*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.21 ms | 1395 KiB | 15 Q