3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = 11; $base = 2; $stack = []; while( $num > 0) { array_push($stack,($num % $base)); // pushes remainder on stack $num = (int) ($num/$base); // no integer division } while($stack) { echo array_pop($stack); // 1011 in final iteration } echo "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
Branch analysis from position: 15
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
Branch analysis from position: 4
filename:       /in/djYBA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $num, !1 = $base, !2 = $stack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 11
    4     1        ASSIGN                                                   !1, 2
    5     2        ASSIGN                                                   !2, <array>
    7     3      > JMP                                                      ->12
    9     4    >   INIT_FCALL                                               'array_push'
          5        SEND_REF                                                 !2
          6        MOD                                              ~6      !0, !1
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                                 
   11     9        DIV                                              ~8      !0, !1
         10        CAST                                          4  ~9      ~8
         11        ASSIGN                                                   !0, ~9
    7    12    >   IS_SMALLER                                               0, !0
         13      > JMPNZ                                                    ~11, ->4
   15    14    > > JMP                                                      ->19
   17    15    >   INIT_FCALL                                               'array_pop'
         16        SEND_REF                                                 !2
         17        DO_ICALL                                         $12     
         18        ECHO                                                     $12
   15    19    > > JMPNZ                                                    !2, ->15
   21    20    >   ECHO                                                     '%0A'
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.04 ms | 1395 KiB | 17 Q