3v4l.org

run code in 300+ PHP versions simultaneously
<?php $integer = 0b100101; $binary = decbin($integer); $binaries = str_split($binary, 1); $binaries = array_reverse($binaries); for ($index = 0; $index < count($binaries); $index++) { $current = &$binaries[$index]; $current = str_pad("", ((count($binaries) - 1) - $index), "0") . $current . str_pad("", $index, "0"); $current = bindec($current); if (empty($current)) { unset($binaries[$index]); } } $binaries = array_values($binaries); var_dump($binaries);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 16
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 16
Branch analysis from position: 45
Branch analysis from position: 16
Branch analysis from position: 41
filename:       /in/oYmTu
function name:  (null)
number of ops:  53
compiled vars:  !0 = $integer, !1 = $binary, !2 = $binaries, !3 = $index, !4 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 37
    4     1        INIT_FCALL                                               'decbin'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    5     5        INIT_FCALL                                               'str_split'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    6    10        INIT_FCALL                                               'array_reverse'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
    8    14        ASSIGN                                                   !3, 0
         15      > JMP                                                      ->42
    9    16    >   FETCH_DIM_W                                      $13     !2, !3
         17        ASSIGN_REF                                               !4, $13
   10    18        INIT_FCALL                                               'str_pad'
         19        SEND_VAL                                                 ''
         20        COUNT                                            ~15     !2
         21        SUB                                              ~16     ~15, 1
         22        SUB                                              ~17     ~16, !3
         23        SEND_VAL                                                 ~17
         24        SEND_VAL                                                 '0'
         25        DO_ICALL                                         $18     
         26        CONCAT                                           ~19     $18, !4
         27        INIT_FCALL                                               'str_pad'
         28        SEND_VAL                                                 ''
         29        SEND_VAR                                                 !3
         30        SEND_VAL                                                 '0'
         31        DO_ICALL                                         $20     
         32        CONCAT                                           ~21     ~19, $20
         33        ASSIGN                                                   !4, ~21
   11    34        INIT_FCALL                                               'bindec'
         35        SEND_VAR                                                 !4
         36        DO_ICALL                                         $23     
         37        ASSIGN                                                   !4, $23
   12    38        ISSET_ISEMPTY_CV                                         !4
         39      > JMPZ                                                     ~25, ->41
   13    40    >   UNSET_DIM                                                !2, !3
    8    41    >   PRE_INC                                                  !3
         42    >   COUNT                                            ~27     !2
         43        IS_SMALLER                                               !3, ~27
         44      > JMPNZ                                                    ~28, ->16
   16    45    >   INIT_FCALL                                               'array_values'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                         $29     
         48        ASSIGN                                                   !2, $29
   18    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !2
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.24 ms | 1404 KiB | 27 Q