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() ) { $num = $stack->pop(); if ($num > 0) { echo $num; $stack->next(); } } echo "\n";
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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 18
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 18
Branch analysis from position: 29
Branch analysis from position: 18
Branch analysis from position: 26
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/Ps9ha
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                                                      ->13
    8     6    >   INIT_METHOD_CALL                                         !2, 'push'
          7        MOD                                              ~8      !0, !1
          8        SEND_VAL_EX                                              ~8
          9        DO_FCALL                                      0          
    9    10        CAST                                          4  ~10     !0
         11        DIV                                              ~11     ~10, !1
         12        ASSIGN                                                   !0, ~11
    6    13    >   IS_SMALLER                                               0, !0
         14      > JMPNZ                                                    ~13, ->6
   11    15    >   INIT_METHOD_CALL                                         !2, 'rewind'
         16        DO_FCALL                                      0          
   13    17      > JMP                                                      ->26
   15    18    >   INIT_METHOD_CALL                                         !2, 'pop'
         19        DO_FCALL                                      0  $15     
         20        ASSIGN                                                   !0, $15
   16    21        IS_SMALLER                                               0, !0
         22      > JMPZ                                                     ~17, ->26
   17    23    >   ECHO                                                     !0
   18    24        INIT_METHOD_CALL                                         !2, 'next'
         25        DO_FCALL                                      0          
   13    26    >   INIT_METHOD_CALL                                         !2, 'valid'
         27        DO_FCALL                                      0  $19     
         28      > JMPNZ                                                    $19, ->18
   22    29    >   ECHO                                                     '%0A'
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.7 ms | 1386 KiB | 13 Q