3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[spoiler]Test\ntesting[/spoiler]."; $text = preg_replace_callback("/\[(.*?)\]/", function($match){ echo "test"; $lines = explode("\n", str_rot13(substr($match[0]))); $output = ""; foreach ($lines as $line) { $output .= "[spoiler]".$line."[/spoiler]"; } return $output; }, $text ); echo $text; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X9293
function name:  (null)
number of ops:  10
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Bspoiler%5DTest%0Atesting%5B%2Fspoiler%5D.'
    5     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%5C%5B%28.%2A%3F%29%5C%5D%2F'
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FX9293%3A6%240'
   15     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    5     7        ASSIGN                                                   !0, $3
   17     8        ECHO                                                     !0
   19     9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FX9293%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/X9293
function name:  {closure}
number of ops:  24
compiled vars:  !0 = $match, !1 = $lines, !2 = $output, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ECHO                                                     'test'
    8     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%0A'
          4        INIT_FCALL                                               'str_rot13'
          5        INIT_FCALL                                               'substr'
          6        FETCH_DIM_R                                      ~4      !0, 0
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
   10    14        ASSIGN                                                   !2, ''
   11    15      > FE_RESET_R                                       $10     !1, ->21
         16    > > FE_FETCH_R                                               $10, !3, ->21
   12    17    >   CONCAT                                           ~11     '%5Bspoiler%5D', !3
         18        CONCAT                                           ~12     ~11, '%5B%2Fspoiler%5D'
         19        ASSIGN_OP                                     8          !2, ~12
   11    20      > JMP                                                      ->16
         21    >   FE_FREE                                                  $10
   14    22      > RETURN                                                   !2
   15    23*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1400 KiB | 21 Q