3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getBitStream($string) { $stream = []; foreach (str_split($string) as $byte) { $bits = str_split(sprintf('%08d', decbin(ord($byte)))); $stream = array_merge($stream, $bits); } return $stream; } var_dump(getBitStream('hello world!'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SdrOc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'getbitstream'
          2        SEND_VAL                                                 'hello+world%21'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function getbitstream:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 27
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/SdrOc
function name:  getBitStream
number of ops:  30
compiled vars:  !0 = $string, !1 = $stream, !2 = $byte, !3 = $bits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5      > FE_RESET_R                                       $6      $5, ->27
          6    > > FE_FETCH_R                                               $6, !2, ->27
    8     7    >   INIT_FCALL                                               'str_split'
          8        INIT_FCALL                                               'sprintf'
          9        SEND_VAL                                                 '%2508d'
         10        INIT_FCALL                                               'decbin'
         11        INIT_FCALL                                               'ord'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !3, $10
    9    21        INIT_FCALL                                               'array_merge'
         22        SEND_VAR                                                 !1
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $12     
         25        ASSIGN                                                   !1, $12
    6    26      > JMP                                                      ->6
         27    >   FE_FREE                                                  $6
   11    28      > RETURN                                                   !1
   12    29*     > RETURN                                                   null

End of function getbitstream

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.2 ms | 1403 KiB | 26 Q