3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matches = array(); $value = '#12 3ff;'; $value = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); $value2 = preg_replace_callback('/&#(\d+);?/m', function($matches) {return chr($matches[1]);}, $value); echo $value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/skcYa
function name:  (null)
number of ops:  17
compiled vars:  !0 = $matches, !1 = $value, !2 = $value2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, '%2312%0A3ff%3B'
    5     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                                         $5      
          7        ASSIGN                                                   !1, $5
    6     8        INIT_FCALL                                               'preg_replace_callback'
          9        SEND_VAL                                                 '%2F%26%23%28%5Cd%2B%29%3B%3F%2Fm'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FskcYa%3A6%240'
         11        SEND_VAL                                                 ~7
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !2, $8
    7    15        ECHO                                                     !1
         16      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FskcYa%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.21 ms | 1395 KiB | 19 Q