3v4l.org

run code in 500+ PHP versions simultaneously
<?php function _hex2bin($hex) { $hex = strtoupper($hex); $hexLen = strlen($hex); $bin = []; for ($i = 0; $i < $hexLen; $i++) { $char = $hex[$i]; $bin[] = str_pad(base_convert($char, 16, 2), 4, '0', STR_PAD_LEFT); } return implode("", $bin); } echo _hex2bin("152F302436152F302435152F302434152F302433152F302433");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MoH8R
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                                   '_hex2bin'
          1        SEND_VAL                                                     '152F302436152F302435152F302434152F302433152F302433'
          2        DO_FCALL                                          0  $0      
          3        ECHO                                                         $0
          4      > RETURN                                                       1

Function _hex2bin:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 10
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 10
Branch analysis from position: 28
Branch analysis from position: 10
filename:       /in/MoH8R
function name:  _hex2bin
number of ops:  31
compiled vars:  !0 = $hex, !1 = $hexLen, !2 = $bin, !3 = $i, !4 = $char
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        INIT_FCALL                                                   'strtoupper'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $5      
          4        ASSIGN                                                       !0, $5
    6     5        STRLEN                                               ~7      !0
          6        ASSIGN                                                       !1, ~7
    7     7        ASSIGN                                                       !2, <array>
    8     8        ASSIGN                                                       !3, 0
          9      > JMP                                                          ->26
    9    10    >   FETCH_DIM_R                                          ~11     !0, !3
         11        ASSIGN                                                       !4, ~11
   10    12        INIT_FCALL                                                   'str_pad'
         13        INIT_FCALL                                                   'base_convert'
         14        SEND_VAR                                                     !4
         15        SEND_VAL                                                     16
         16        SEND_VAL                                                     2
         17        DO_ICALL                                             $14     
         18        SEND_VAR                                                     $14
         19        SEND_VAL                                                     4
         20        SEND_VAL                                                     '0'
         21        SEND_VAL                                                     0
         22        DO_ICALL                                             $15     
         23        ASSIGN_DIM                                                   !2
         24        OP_DATA                                                      $15
    8    25        PRE_INC                                                      !3
         26    >   IS_SMALLER                                                   !3, !1
         27      > JMPNZ                                                        ~17, ->10
   13    28    >   FRAMELESS_ICALL_2                implode             ~18     '', !2
         29      > RETURN                                                       ~18
   14    30*     > RETURN                                                       null

End of function _hex2bin

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.23 ms | 2147 KiB | 17 Q