3v4l.org

run code in 300+ PHP versions simultaneously
<?php $num = 11; $base = 2; 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 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 14
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 14
Branch analysis from position: 19
Branch analysis from position: 14
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
filename:       /in/YhT8S
function name:  (null)
number of ops:  21
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
    6     2      > JMP                                                      ->11
    8     3    >   INIT_FCALL                                               'array_push'
          4        SEND_REF                                                 !2
          5        MOD                                              ~5      !0, !1
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                                 
   10     8        DIV                                              ~7      !0, !1
          9        CAST                                          4  ~8      ~7
         10        ASSIGN                                                   !0, ~8
    6    11    >   IS_SMALLER                                               0, !0
         12      > JMPNZ                                                    ~10, ->3
   14    13    > > JMP                                                      ->18
   16    14    >   INIT_FCALL                                               'array_pop'
         15        SEND_REF                                                 !2
         16        DO_ICALL                                         $11     
         17        ECHO                                                     $11
   14    18    > > JMPNZ                                                    !2, ->14
   20    19    >   ECHO                                                     '%0A'
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.84 ms | 1400 KiB | 17 Q