3v4l.org

run code in 300+ PHP versions simultaneously
<?php $commands = new \SplStack(); $commands->push(1); $commands->push(2); $commands->rewind(); while ($commands->valid()) { $cmd = $commands->pop(); echo "$cmd\n"; $commands->next(); } echo 'count: '.$commands->count();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 12
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 12
Branch analysis from position: 23
Branch analysis from position: 12
filename:       /in/GPvYk
function name:  (null)
number of ops:  28
compiled vars:  !0 = $commands, !1 = $cmd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'SplStack'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        INIT_METHOD_CALL                                         !0, 'push'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
    4     6        INIT_METHOD_CALL                                         !0, 'push'
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0          
    5     9        INIT_METHOD_CALL                                         !0, 'rewind'
         10        DO_FCALL                                      0          
    6    11      > JMP                                                      ->20
    7    12    >   INIT_METHOD_CALL                                         !0, 'pop'
         13        DO_FCALL                                      0  $8      
         14        ASSIGN                                                   !1, $8
    8    15        NOP                                                      
         16        FAST_CONCAT                                      ~10     !1, '%0A'
         17        ECHO                                                     ~10
    9    18        INIT_METHOD_CALL                                         !0, 'next'
         19        DO_FCALL                                      0          
    6    20    >   INIT_METHOD_CALL                                         !0, 'valid'
         21        DO_FCALL                                      0  $12     
         22      > JMPNZ                                                    $12, ->12
   11    23    >   INIT_METHOD_CALL                                         !0, 'count'
         24        DO_FCALL                                      0  $13     
         25        CONCAT                                           ~14     'count%3A+', $13
         26        ECHO                                                     ~14
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.36 ms | 1394 KiB | 13 Q