3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "oAA34Ao#\\\\oo+--)o/"; echo preg_replace_callback( '/([\x00-\x1F\*\(\)\\\\])/', function ($matches) { return "\\".join("", unpack("H2", $matches[1])); }, $str ); $str = "oAA34Ao#\\\\oo+--)o/"; function matches($matches) { $x = "\\".join("", unpack("H2", $matches[1])); echo $x; return $x; } 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/XpcmD
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'oAA34Ao%23%5C%5Coo%2B--%29o%2F'
    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%2FXpcmD%3A7%240'
    9     4        SEND_VAL                                                 ~2
   10     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
   13     8        ASSIGN                                                   !0, 'oAA34Ao%23%5C%5Coo%2B--%29o%2F'
   20     9        INIT_FCALL                                               'mb_ereg_replace_callback'
   21    10        SEND_VAL                                                 '%28%5B%5Cx00-%5Cx1F%5C%2A%5C%28%5C%29%5C%5C%5D%29'
   22    11        SEND_VAL                                                 'matches'
   23    12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        CONCAT                                           ~6      '+++++++', $5
         15        ECHO                                                     ~6
   25    16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXpcmD%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XpcmD
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%2FXpcmD%3A7%240

Function matches:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XpcmD
function name:  matches
number of ops:  15
compiled vars:  !0 = $matches, !1 = $x
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                                      ~2      !0, 1
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                         $4      
         10        CONCAT                                           ~5      '%5C', $4
         11        ASSIGN                                                   !1, ~5
   16    12        ECHO                                                     !1
   17    13      > RETURN                                                   !1
   18    14*     > RETURN                                                   null

End of function matches

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.08 ms | 1392 KiB | 21 Q