3v4l.org

run code in 300+ PHP versions simultaneously
<?php $commands = new \SplStack(); $commands->push(1); $commands->push(2); $commands->rewind(); while (!$commands->isEmpty()) { $cmd = $commands->pop(); echo "$cmd\n"; } echo 'count: '.$commands->count();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
Branch analysis from position: 12
filename:       /in/fZKT8
function name:  (null)
number of ops:  27
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                                                      ->18
    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
    6    18    >   INIT_METHOD_CALL                                         !0, 'isEmpty'
         19        DO_FCALL                                      0  $11     
         20        BOOL_NOT                                         ~12     $11
         21      > JMPNZ                                                    ~12, ->12
   10    22    >   INIT_METHOD_CALL                                         !0, 'count'
         23        DO_FCALL                                      0  $13     
         24        CONCAT                                           ~14     'count%3A+', $13
         25        ECHO                                                     ~14
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.71 ms | 1394 KiB | 13 Q