3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createStringFromMap($map) { $chars = array('C*'); foreach (array_chunk($map, 8) as $byte) { $char = 0; foreach ($byte as $position => $bit) { $char |= ($bit << (7 - $position)); } $chars[] = $char; } return call_user_func_array('pack', $chars); } echo createStringFromMap(array(0, 1, 0, 0, 0, 0, 0, 1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L9NT8
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'createstringfrommap'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function createstringfrommap:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/L9NT8
function name:  createStringFromMap
number of ops:  27
compiled vars:  !0 = $map, !1 = $chars, !2 = $byte, !3 = $char, !4 = $bit, !5 = $position
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_chunk'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 8
          5        DO_ICALL                                         $7      
          6      > FE_RESET_R                                       $8      $7, ->20
          7    > > FE_FETCH_R                                               $8, !2, ->20
    6     8    >   ASSIGN                                                   !3, 0
    7     9      > FE_RESET_R                                       $10     !2, ->16
         10    > > FE_FETCH_R                                       ~11     $10, !4, ->16
         11    >   ASSIGN                                                   !5, ~11
    8    12        SUB                                              ~13     7, !5
         13        SL                                               ~14     !4, ~13
         14        ASSIGN_OP                                     9          !3, ~14
    7    15      > JMP                                                      ->10
         16    >   FE_FREE                                                  $10
   10    17        ASSIGN_DIM                                               !1
         18        OP_DATA                                                  !3
    5    19      > JMP                                                      ->7
         20    >   FE_FREE                                                  $8
   12    21        INIT_FCALL                                               'pack'
         22        SEND_ARRAY                                               !1
         23        CHECK_UNDEF_ARGS                                         
         24        DO_FCALL                                      0  $17     
         25      > RETURN                                                   $17
   13    26*     > RETURN                                                   null

End of function createstringfrommap

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.61 ms | 1402 KiB | 18 Q