3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MapObjectData extends SplObjectStorage { public function key () { return parent::current (); } public function current () { return parent::getInfo (); } } $spl = new MapObjectData (); $spl[new StdClass ()] = 'a'; $spl[new StdClass ()] = 'b'; foreach ($spl as $object => $data) { var_dump ($object, $data); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/4hAh9
function name:  (null)
number of ops:  21
compiled vars:  !0 = $spl, !1 = $data, !2 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'MapObjectData'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   15     3        NEW                                              $6      'StdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0, $6
          6        OP_DATA                                                  'a'
   16     7        NEW                                              $9      'StdClass'
          8        DO_FCALL                                      0          
          9        ASSIGN_DIM                                               !0, $9
         10        OP_DATA                                                  'b'
   17    11      > FE_RESET_R                                       $12     !0, ->19
         12    > > FE_FETCH_R                                       ~13     $12, !1, ->19
         13    >   ASSIGN                                                   !2, ~13
   19    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   17    18      > JMP                                                      ->12
         19    >   FE_FREE                                                  $12
   20    20      > RETURN                                                   1

Class MapObjectData:
Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hAh9
function name:  key
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'current'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function key

Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4hAh9
function name:  current
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'getInfo'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   12     3*     > RETURN                                                   null

End of function current

End of class MapObjectData.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1396 KiB | 15 Q