3v4l.org

run code in 300+ PHP versions simultaneously
<?php $spl = new SplObjectStorage (); $keyForA = (object) ['key' => 'A']; $keyForB = (object) ['key' => 'B']; $spl[$keyForA] = 'value a'; $spl[$keyForB] = 'value b'; foreach ($spl as $i => $key) { $value = $spl[$key]; print "Index: $i\n"; print "Key: " . var_export($key, TRUE) . "\n";; print "Value: " . var_export($value, TRUE) . "\n";; print "\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 36
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 36
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/8dXCH
function name:  (null)
number of ops:  38
compiled vars:  !0 = $spl, !1 = $keyForA, !2 = $keyForB, !3 = $key, !4 = $i, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'SplObjectStorage'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    4     3        CAST                                          8  ~9      <array>
          4        ASSIGN                                                   !1, ~9
    5     5        CAST                                          8  ~11     <array>
          6        ASSIGN                                                   !2, ~11
    7     7        ASSIGN_DIM                                               !0, !1
          8        OP_DATA                                                  'value+a'
    8     9        ASSIGN_DIM                                               !0, !2
         10        OP_DATA                                                  'value+b'
   10    11      > FE_RESET_R                                       $15     !0, ->36
         12    > > FE_FETCH_R                                       ~16     $15, !3, ->36
         13    >   ASSIGN                                                   !4, ~16
   11    14        FETCH_DIM_R                                      ~18     !0, !3
         15        ASSIGN                                                   !5, ~18
   13    16        ROPE_INIT                                     3  ~21     'Index%3A+'
         17        ROPE_ADD                                      1  ~21     ~21, !4
         18        ROPE_END                                      2  ~20     ~21, '%0A'
         19        ECHO                                                     ~20
   14    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !3
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $23     
         24        CONCAT                                           ~24     'Key%3A+', $23
         25        CONCAT                                           ~25     ~24, '%0A'
         26        ECHO                                                     ~25
   15    27        INIT_FCALL                                               'var_export'
         28        SEND_VAR                                                 !5
         29        SEND_VAL                                                 <true>
         30        DO_ICALL                                         $26     
         31        CONCAT                                           ~27     'Value%3A+', $26
         32        CONCAT                                           ~28     ~27, '%0A'
         33        ECHO                                                     ~28
   16    34        ECHO                                                     '%0A'
   10    35      > JMP                                                      ->12
         36    >   FE_FREE                                                  $15
   18    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.51 ms | 1401 KiB | 15 Q