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 } //$stack->rewind(); while( $stack->valid() ){ echo $stack->pop(); $stack->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 16
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 16
Branch analysis from position: 24
Branch analysis from position: 16
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
Branch analysis from position: 6
filename:       /in/Tvjkt
function name:  (null)
number of ops:  25
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                                                      ->13
    7     6    >   INIT_METHOD_CALL                                         !2, 'push'
          7        MOD                                              ~8      !0, !1
          8        SEND_VAL_EX                                              ~8
          9        DO_FCALL                                      0          
    8    10        DIV                                              ~10     !0, !1
         11        CAST                                          4  ~11     ~10
         12        ASSIGN                                                   !0, ~11
    6    13    >   IS_SMALLER                                               0, !0
         14      > JMPNZ                                                    ~13, ->6
   13    15    > > JMP                                                      ->21
   14    16    >   INIT_METHOD_CALL                                         !2, 'pop'
         17        DO_FCALL                                      0  $14     
         18        ECHO                                                     $14
   15    19        INIT_METHOD_CALL                                         !2, 'next'
         20        DO_FCALL                                      0          
   13    21    >   INIT_METHOD_CALL                                         !2, 'valid'
         22        DO_FCALL                                      0  $16     
         23      > JMPNZ                                                    $16, ->16
   16    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
291.53 ms | 1395 KiB | 14 Q