3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/\[CODE\](.*)\[\/CODE\]/'; $replacement = function($m) { return htmlentities($m[0]); }; $subject = <<<EOT <html> <body> <div id="box1">[CODE]<span class="test">Hello World</span>[/CODE]</div> <div id="box2">[CODE]<strong class="test2">Nice to meet you!</strong>[/CODE]</div> </body> </html> EOT; echo preg_replace($pattern, $replacement, $subject);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KK9G
function name:  (null)
number of ops:  11
compiled vars:  !0 = $pattern, !1 = $replacement, !2 = $subject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5C%5BCODE%5C%5D%28.%2A%29%5C%5B%5C%2FCODE%5C%5D%2F'
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6KK9G%3A4%240'
          2        ASSIGN                                                   !1, ~4
    6     3        ASSIGN                                                   !2, '%3Chtml%3E%0A%3Cbody%3E%0A%3Cdiv+id%3D%22box1%22%3E%5BCODE%5D%3Cspan+class%3D%22test%22%3EHello+World%3C%2Fspan%3E%5B%2FCODE%5D%3C%2Fdiv%3E%0A%3Cdiv+id%3D%22box2%22%3E%5BCODE%5D%3Cstrong+class%3D%22test2%22%3ENice+to+meet+you%21%3C%2Fstrong%3E%5B%2FCODE%5D%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   15     4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        ECHO                                                     $7
         10      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F6KK9G%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.85 ms | 1395 KiB | 17 Q