3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stack = new SplStack(); $stack->push('a'); $stack->push('b'); $stack->push('c'); $stack->offsetSet(0, 'C'); # the last element has index zero $stack->rewind(); while( $stack->valid() ) { echo $stack->current(), PHP_EOL; $stack->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 19
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 19
Branch analysis from position: 28
Branch analysis from position: 19
filename:       /in/slsiH
function name:  (null)
number of ops:  29
compiled vars:  !0 = $stack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $1      'SplStack'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    3     3        INIT_METHOD_CALL                                         !0, 'push'
          4        SEND_VAL_EX                                              'a'
          5        DO_FCALL                                      0          
    4     6        INIT_METHOD_CALL                                         !0, 'push'
          7        SEND_VAL_EX                                              'b'
          8        DO_FCALL                                      0          
    5     9        INIT_METHOD_CALL                                         !0, 'push'
         10        SEND_VAL_EX                                              'c'
         11        DO_FCALL                                      0          
    7    12        INIT_METHOD_CALL                                         !0, 'offsetSet'
         13        SEND_VAL_EX                                              0
         14        SEND_VAL_EX                                              'C'
         15        DO_FCALL                                      0          
    9    16        INIT_METHOD_CALL                                         !0, 'rewind'
         17        DO_FCALL                                      0          
   11    18      > JMP                                                      ->25
   13    19    >   INIT_METHOD_CALL                                         !0, 'current'
         20        DO_FCALL                                      0  $9      
         21        ECHO                                                     $9
         22        ECHO                                                     '%0A'
   14    23        INIT_METHOD_CALL                                         !0, 'next'
         24        DO_FCALL                                      0          
   11    25    >   INIT_METHOD_CALL                                         !0, 'valid'
         26        DO_FCALL                                      0  $11     
         27      > JMPNZ                                                    $11, ->19
   15    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.72 ms | 1395 KiB | 13 Q