3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matches = array(); $value = '#123456;'; $tempval = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); //"' $tempval = preg_replace('/&#x([0-9a-f]+);?/mei', "chr(hexdec('\\1'))", $tempval); var_dump($tempval); $tempval2 = preg_replace_callback('/&#(\d+);?/m', function($matches) { return chr($matches[1]); }, $value); $value2 = preg_replace_callback('/&#x([0-9a-f]+);?/mi', function($matches) { return chr(hexdec($matches[1])); }, $tempval2); var_dump($value2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VSL3l
function name:  (null)
number of ops:  35
compiled vars:  !0 = $matches, !1 = $value, !2 = $tempval, !3 = $tempval2, !4 = $value2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, '%23123456%3B'
    6     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%26%23%28%5Cd%2B%29%3B%3F%2Fme'
          4        SEND_VAL                                                 'chr%28%27%5C1%27%29'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
    7     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%2F%26%23x%28%5B0-9a-f%5D%2B%29%3B%3F%2Fmei'
         10        SEND_VAL                                                 'chr%28hexdec%28%27%5C1%27%29%29'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
    8    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
   10    17        INIT_FCALL                                               'preg_replace_callback'
         18        SEND_VAL                                                 '%2F%26%23%28%5Cd%2B%29%3B%3F%2Fm'
         19        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVSL3l%3A10%240'
   12    20        SEND_VAL                                                 ~12
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $13     
   10    23        ASSIGN                                                   !3, $13
   13    24        INIT_FCALL                                               'preg_replace_callback'
         25        SEND_VAL                                                 '%2F%26%23x%28%5B0-9a-f%5D%2B%29%3B%3F%2Fmi'
         26        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVSL3l%3A13%241'
   15    27        SEND_VAL                                                 ~15
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $16     
   13    30        ASSIGN                                                   !4, $16
   16    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVSL3l%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VSL3l
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'chr'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   12     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVSL3l%3A10%240

Function %00%7Bclosure%7D%2Fin%2FVSL3l%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VSL3l
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'chr'
          2        INIT_FCALL                                               'hexdec'
          3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
   15     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVSL3l%3A13%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.14 ms | 1400 KiB | 23 Q