3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SOS extends SplObjectStorage { public function key() { return parent::current(); } public function current() { return parent::getInfo(); } } $a = array('User' => array(1 => new SOS)); $a['User'][1]->attach(new StdClass, new StdClass); var_dump($a); foreach ($a['User'][1] as $actor => $entity) var_dump($actor, $entity);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/n94af
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $entity, !2 = $actor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $3      'SOS'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~5      $3, 1
          3        INIT_ARRAY                                       ~6      ~5, 'User'
          4        ASSIGN                                                   !0, ~6
   18     5        FETCH_DIM_R                                      ~8      !0, 'User'
          6        FETCH_DIM_R                                      ~9      ~8, 1
          7        INIT_METHOD_CALL                                         ~9, 'attach'
          8        NEW                                              $10     'StdClass'
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $10
         11        NEW                                              $12     'StdClass'
         12        DO_FCALL                                      0          
         13        SEND_VAR_NO_REF_EX                                       $12
         14        DO_FCALL                                      0          
   20    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
   22    18        FETCH_DIM_R                                      ~16     !0, 'User'
         19        FETCH_DIM_R                                      ~17     ~16, 1
         20      > FE_RESET_R                                       $18     ~17, ->28
         21    > > FE_FETCH_R                                       ~19     $18, !1, ->28
         22    >   ASSIGN                                                   !2, ~19
   23    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
   22    27      > JMP                                                      ->21
         28    >   FE_FREE                                                  $18
   23    29      > RETURN                                                   1

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

End of function current

End of class SOS.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
274.19 ms | 1400 KiB | 16 Q