3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_hex($hex_code) { return @preg_match("/^[a-f0-9]{2,}$/i", $hex_code) && !(strlen($hex_code) & 1); } var_dump(is_hex("A"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pbkZk
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'is_hex'
          2        SEND_VAL                                                 'A'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function is_hex:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/pbkZk
function name:  is_hex
number of ops:  14
compiled vars:  !0 = $hex_code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        BEGIN_SILENCE                                    ~1      
          2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%5E%5Ba-f0-9%5D%7B2%2C%7D%24%2Fi'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        END_SILENCE                                              ~1
          7      > JMPZ_EX                                          ~3      $2, ->12
          8    >   STRLEN                                           ~4      !0
          9        BW_AND                                           ~5      ~4, 1
         10        BOOL_NOT                                         ~6      ~5
         11        BOOL                                             ~3      ~6
         12    > > RETURN                                                   ~3
    5    13*     > RETURN                                                   null

End of function is_hex

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.29 ms | 1397 KiB | 18 Q