3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x extends ArrayObject { public function offsetGet($key) { static $i = 0; $i++; if ($i == 1) return $this[$key]; else return 'bla';} } $x = new x(); var_dump($x['test']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t3Krt
function name:  (null)
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        INIT_FCALL                                               'var_dump'
          4        FETCH_DIM_R                                      ~4      !0, 'test'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class x:
Function offsetget:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t3Krt
function name:  offsetGet
number of ops:  11
compiled vars:  !0 = $key, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        PRE_INC                                                  !1
          3        IS_EQUAL                                                 !1, 1
          4      > JMPZ                                                     ~3, ->9
          5    >   FETCH_THIS                                       ~4      
          6        FETCH_DIM_R                                      ~5      ~4, !0
          7      > RETURN                                                   ~5
          8*       JMP                                                      ->10
          9    > > RETURN                                                   'bla'
         10*     > RETURN                                                   null

End of function offsetget

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.09 ms | 1395 KiB | 15 Q