3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "oAAAoooo"; echo preg_replace_callback( '/([\x00-\x1F\*\(\)\\\\])/', function ($matches) { return "\\".join("", unpack("H2", $matches[1])); }, $str ); $str = "oAAAoooo"; function matches($matches) { return "\\".join("", unpack("H2", $matches[1])); } echo mb_ereg_replace_callback( '([\x00-\x1F\*\(\)\\\\])', "matches", $str ); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AaN2s
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'oAAAoooo'
    5     1        INIT_FCALL                                               'preg_replace_callback'
    6     2        SEND_VAL                                                 '%2F%28%5B%5Cx00-%5Cx1F%5C%2A%5C%28%5C%29%5C%5C%5D%29%2F'
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAaN2s%3A7%240'
    9     4        SEND_VAL                                                 ~2
   10     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
   13     8        ASSIGN                                                   !0, 'oAAAoooo'
   18     9        INIT_FCALL                                               'mb_ereg_replace_callback'
   19    10        SEND_VAL                                                 '%28%5B%5Cx00-%5Cx1F%5C%2A%5C%28%5C%29%5C%5C%5D%29'
   20    11        SEND_VAL                                                 'matches'
   21    12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
   23    15      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FAaN2s%3A7%240

Function matches:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AaN2s
function name:  matches
number of ops:  13
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'join'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'unpack'
          4        SEND_VAL                                                 'H2'
          5        FETCH_DIM_R                                      ~1      !0, 1
          6        SEND_VAL                                                 ~1
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        CONCAT                                           ~4      '%5C', $3
         11      > RETURN                                                   ~4
   16    12*     > RETURN                                                   null

End of function matches

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.8 ms | 1392 KiB | 21 Q