3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'abc<abc>abc> => cbc<bbc>cbc>'; $str = preg_replace_callback('/(<)[^>]++>|.++/', function ($m) { return str_replace($m, 'a', isset($m[1]) ? 'b' : 'c', $m[0]); }, $str); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hr2SE
function name:  (null)
number of ops:  10
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'abc%3Cabc%3Eabc%3E+%3D%3E+cbc%3Cbbc%3Ecbc%3E'
    5     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%28%3C%29%5B%5E%3E%5D%2B%2B%3E%7C.%2B%2B%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fhr2SE%3A5%240'
    7     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    5     7        ASSIGN                                                   !0, $3
    9     8        ECHO                                                     !0
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fhr2SE%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hr2SE
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'a'
          4        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 1
          5      > JMPZ                                                     ~1, ->8
          6    >   QM_ASSIGN                                        ~2      'b'
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~2      'c'
          9    >   SEND_VAL                                                 ~2
         10        FETCH_DIM_W                                      $3      !0, 0
         11        SEND_REF                                                 $3
         12        DO_ICALL                                         $4      
         13      > RETURN                                                   $4
    7    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fhr2SE%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.96 ms | 1396 KiB | 17 Q