3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[spoiler] \n \nTst. \n \nTestt. \n \nTEstst \n \nTESTST \nESTET \n \n[/spoiler]"; $text = preg_replace_callback("(\[spoiler\](.*?)\[\/spoiler\])is", function($match){ $lines = explode("\n", str_rot13($match[1])); foreach ($lines as &$line) { if (!empty($line)) $line = "[spoiler]".$line."[/spoiler]"; } unset($line); $output = implode("\n",$lines); return $output; }, $text ); echo $text; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6fkLt
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%5D+%0A+%0ATst.+%0A+%0ATestt.+%0A+%0ATEstst+%0A+%0ATESTST+%0AESTET+%0A+%0A%5B%2Fspoiler%5D'
    5     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%28%5C%5Bspoiler%5C%5D%28.%2A%3F%29%5C%5B%5C%2Fspoiler%5C%5D%29is'
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6fkLt%3A6%240'
   14     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    5     7        ASSIGN                                                   !0, $3
   16     8        ECHO                                                     !0
   18     9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F6fkLt%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 126) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/6fkLt
function name:  {closure}
number of ops:  28
compiled vars:  !0 = $match, !1 = $lines, !2 = $line, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        INIT_FCALL                                               'str_rot13'
          4        FETCH_DIM_R                                      ~4      !0, 1
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
    8    10      > FE_RESET_RW                                      $8      !1, ->19
         11    > > FE_FETCH_RW                                              $8, !2, ->19
    9    12    >   ISSET_ISEMPTY_CV                                 ~9      !2
         13        BOOL_NOT                                         ~10     ~9
         14      > JMPZ                                                     ~10, ->18
         15    >   CONCAT                                           ~11     '%5Bspoiler%5D', !2
         16        CONCAT                                           ~12     ~11, '%5B%2Fspoiler%5D'
         17        ASSIGN                                                   !2, ~12
    8    18    > > JMP                                                      ->11
         19    >   FE_FREE                                                  $8
   11    20        UNSET_CV                                                 !2
   12    21        INIT_FCALL                                               'implode'
         22        SEND_VAL                                                 '%0A'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $14     
         25        ASSIGN                                                   !3, $14
   13    26      > RETURN                                                   !3
   14    27*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.86 ms | 1400 KiB | 21 Q