3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hexColor = '012'; $color = implode('', array_map(function($color){ return str_repeat($color, 2); }, str_split($hexColor))); echo $color; echo PHP_EOL; print_r( array( 'R' => hexdec($color[0] . $color[1]), 'G' => hexdec($color[2] . $color[3]), 'B' => hexdec($color[4] . $color[5]), ) ); sscanf($color, '%02x%02x%02x', $RGB['R'], $RGB['G'], $RGB['B']); print_r( $RGB ); echo PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WHiBM
function name:  (null)
number of ops:  55
compiled vars:  !0 = $hexColor, !1 = $color, !2 = $RGB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '012'
    4     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWHiBM%3A4%240'
          5        SEND_VAL                                                 ~4
          6        INIT_FCALL                                               'str_split'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
    6    14        ECHO                                                     !1
    7    15        ECHO                                                     '%0A'
    9    16        INIT_FCALL                                               'print_r'
   10    17        INIT_FCALL                                               'hexdec'
         18        FETCH_DIM_R                                      ~9      !1, 0
         19        FETCH_DIM_R                                      ~10     !1, 1
         20        CONCAT                                           ~11     ~9, ~10
         21        SEND_VAL                                                 ~11
         22        DO_ICALL                                         $12     
         23        INIT_ARRAY                                       ~13     $12, 'R'
   11    24        INIT_FCALL                                               'hexdec'
         25        FETCH_DIM_R                                      ~14     !1, 2
         26        FETCH_DIM_R                                      ~15     !1, 3
         27        CONCAT                                           ~16     ~14, ~15
         28        SEND_VAL                                                 ~16
         29        DO_ICALL                                         $17     
         30        ADD_ARRAY_ELEMENT                                ~13     $17, 'G'
   12    31        INIT_FCALL                                               'hexdec'
         32        FETCH_DIM_R                                      ~18     !1, 4
         33        FETCH_DIM_R                                      ~19     !1, 5
         34        CONCAT                                           ~20     ~18, ~19
         35        SEND_VAL                                                 ~20
         36        DO_ICALL                                         $21     
         37        ADD_ARRAY_ELEMENT                                ~13     $21, 'B'
         38        SEND_VAL                                                 ~13
         39        DO_ICALL                                                 
   15    40        INIT_FCALL                                               'sscanf'
         41        SEND_VAR                                                 !1
         42        SEND_VAL                                                 '%2502x%2502x%2502x'
         43        FETCH_DIM_W                                      $23     !2, 'R'
         44        SEND_REF                                                 $23
         45        FETCH_DIM_W                                      $24     !2, 'G'
         46        SEND_REF                                                 $24
         47        FETCH_DIM_W                                      $25     !2, 'B'
         48        SEND_REF                                                 $25
         49        DO_ICALL                                                 
   16    50        INIT_FCALL                                               'print_r'
         51        SEND_VAR                                                 !2
         52        DO_ICALL                                                 
   18    53        ECHO                                                     '%0A'
         54      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FWHiBM%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WHiBM
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $color
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'str_repeat'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWHiBM%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.18 ms | 1400 KiB | 27 Q