3v4l.org

run code in 500+ 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:  20
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_callback'
          9        SEND_VAL                                                     '%7E%28%3Fs%29%3Cpre%3E.%2A%3F%3C%2Fpre%3E%7E'
         10        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
         11        SEND_VAL                                                     ~4
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                             $5      
         14        FRAMELESS_ICALL_3                preg_replace        ~6      '%7E%3C%28%2F%3F%29b%3E%7E', '%5B%241b%5D'
         15        OP_DATA                                                      $5
         16        SEND_VAL                                                     ~6
         17        DO_ICALL                                             $7      
         18        ECHO                                                         $7
         19      > 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:/in/UZbc2:9}
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:/in/UZbc2:9}
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.5.0


preferences:
172.14 ms | 2008 KiB | 16 Q