3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str=" <b>test</b> <pre> <b>test</b> </pre> <b>test</b> "; echo preg_replace_callback(htmlspecialchars('~(?s)<pre>.*?</pre>~'), function($match) { return htmlspecialchars_decode($match[0]);}, preg_replace('~<(/?)b>~','[$1b]', preg_replace_callback('~(?s)<pre>.*?</pre>~', function($match) { return htmlspecialchars($match[0]);}, $str)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UZbc2
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A%3Cb%3Etest%3C%2Fb%3E%0A%3Cpre%3E%0A%3Cb%3Etest%3C%2Fb%3E%0A%3C%2Fpre%3E%0A%3Cb%3Etest%3C%2Fb%3E%0A'
    9     1        INIT_FCALL                                               'preg_replace_callback'
          2        INIT_FCALL                                               'htmlspecialchars'
          3        SEND_VAL                                                 '%7E%28%3Fs%29%3Cpre%3E.%2A%3F%3C%2Fpre%3E%7E'
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          7        SEND_VAL                                                 ~3
          8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%7E%3C%28%2F%3F%29b%3E%7E'
         10        SEND_VAL                                                 '%5B%241b%5D'
         11        INIT_FCALL                                               'preg_replace_callback'
         12        SEND_VAL                                                 '%7E%28%3Fs%29%3Cpre%3E.%2A%3F%3C%2Fpre%3E%7E'
         13        DECLARE_LAMBDA_FUNCTION                          ~4      [1]
         14        SEND_VAL                                                 ~4
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $5      
         17        SEND_VAR                                                 $5
         18        DO_ICALL                                         $6      
         19        SEND_VAR                                                 $6
         20        DO_ICALL                                         $7      
         21        ECHO                                                     $7
         22      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UZbc2
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'htmlspecialchars_decode'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UZbc2
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'htmlspecialchars'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
268.36 ms | 1018 KiB | 17 Q