3v4l.org

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

Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ElUI2
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'x'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class class@anonymous.

Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ElUI2
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'y'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.72 ms | 1006 KiB | 14 Q