3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.03 ms | 1396 KiB | 15 Q