3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '${\\"GL\\x47\\x4c\\x4c\\x53\\"}'; echo preg_replace_callback( '/\\\\x([\da-fA-F]+)/', fn($m) => pack("H*", $m[1]), $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gA0ka
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%24%7B%5C%22GL%5Cx47%5Cx4c%5Cx4c%5Cx53%5C%22%7D'
    5     1        INIT_FCALL                                               'preg_replace_callback'
    6     2        SEND_VAL                                                 '%2F%5C%5Cx%28%5B%5Cda-fA-F%5D%2B%29%2F'
    7     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          4        SEND_VAL                                                 ~2
    8     5        SEND_VAR                                                 !0
    5     6        DO_ICALL                                         $3      
    8     7        ECHO                                                     $3
    9     8      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gA0ka
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'pack'
          2        SEND_VAL                                                 'H%2A'
          3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.58 ms | 1011 KiB | 15 Q