3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = json_decode('{"a": "\u000f\u000f?\u001f\u000f\u000e\u000f\u001e\u00c3"}')->a; var_dump(hex($str)); $str = preg_replace('/[\x00-\x19\x7f]/', '', $str); var_dump(hex($str)); function hex($s) { $h = ''; for ($i = 0; $i < strlen($s); $i++) { $h .= dechex(ord($s[$i])) . ' '; } return $h; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Aer61
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22a%22%3A+%22%5Cu000f%5Cu000f%3F%5Cu001f%5Cu000f%5Cu000e%5Cu000f%5Cu001e%5Cu00c3%22%7D'
          2        DO_ICALL                                         $1      
          3        FETCH_OBJ_R                                      ~2      $1, 'a'
          4        ASSIGN                                                   !0, ~2
    3     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL_BY_NAME                                       'hex'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
    4    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%5B%5Cx00-%5Cx19%5Cx7f%5D%2F'
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $6      
         16        ASSIGN                                                   !0, $6
    5    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL_BY_NAME                                       'hex'
         19        SEND_VAR_EX                                              !0
         20        DO_FCALL                                      0  $8      
         21        SEND_VAR                                                 $8
         22        DO_ICALL                                                 
   13    23      > RETURN                                                   1

Function hex:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
Branch analysis from position: 4
filename:       /in/Aer61
function name:  hex
number of ops:  19
compiled vars:  !0 = $s, !1 = $h, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN                                                   !1, ''
    9     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->14
   10     4    >   INIT_FCALL                                               'dechex'
          5        INIT_FCALL                                               'ord'
          6        FETCH_DIM_R                                      ~5      !0, !2
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      $7, '+'
         12        ASSIGN_OP                                     8          !1, ~8
    9    13        PRE_INC                                                  !2
         14    >   STRLEN                                           ~11     !0
         15        IS_SMALLER                                               !2, ~11
         16      > JMPNZ                                                    ~12, ->4
   12    17    > > RETURN                                                   !1
   13    18*     > RETURN                                                   null

End of function hex

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.12 ms | 1400 KiB | 23 Q