3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'abc<abc>abc>'; $str = preg_replace_callback('/<[^>]++>|(.)++/', function ($m) { return str_replace('a', isset($m[1]) ? 'c' : 'b', $m[0]); }, $str); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LFHXh
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'
    5     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%3C%5B%5E%3E%5D%2B%2B%3E%7C%28.%29%2B%2B%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLFHXh%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%2FLFHXh%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LFHXh
function name:  {closure}
number of ops:  14
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_VAL                                                 'a'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 1
          4      > JMPZ                                                     ~1, ->7
          5    >   QM_ASSIGN                                        ~2      'c'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~2      'b'
          8    >   SEND_VAL                                                 ~2
          9        FETCH_DIM_R                                      ~3      !0, 0
         10        SEND_VAL                                                 ~3
         11        DO_ICALL                                         $4      
         12      > RETURN                                                   $4
    7    13*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.6 ms | 1388 KiB | 17 Q