3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Ints extends ArrayObject { public function offsetGet($index) : int { var_dump('offsetGet'); return parent::offsetGet($index); } } $ints = new Ints([1,2,'foo']); for ($i = 0; $i < 3; $i++) { var_dump($ints[$i]); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 6
Branch analysis from position: 13
Branch analysis from position: 6
filename:       /in/1njNa
function name:  (null)
number of ops:  14
compiled vars:  !0 = $ints, !1 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $2      'Ints'
          1        SEND_VAL_EX                                                  <array>
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   11     4        ASSIGN                                                       !1, 0
          5      > JMP                                                          ->11
   12     6    >   INIT_FCALL                                                   'var_dump'
          7        FETCH_DIM_R                                          ~6      !0, !1
          8        SEND_VAL                                                     ~6
          9        DO_ICALL                                                     
   11    10        PRE_INC                                                      !1
         11    >   IS_SMALLER                                                   !1, 3
         12      > JMPNZ                                                        ~9, ->6
   13    13    > > RETURN                                                       1

Class Ints:
Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1njNa
function name:  offsetGet
number of ops:  11
compiled vars:  !0 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'var_dump'
          2        SEND_VAL                                                     'offsetGet'
          3        DO_ICALL                                                     
    6     4        INIT_STATIC_METHOD_CALL                                      'offsetGet'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $2      
          7        VERIFY_RETURN_TYPE                                           $2
          8      > RETURN                                                       $2
    7     9*       VERIFY_RETURN_TYPE                                           
         10*     > RETURN                                                       null

End of function offsetget

End of class Ints.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.71 ms | 3224 KiB | 14 Q