3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <html> <head><HEADER/></head> <body> <CONTENT/> </body> <FOOTER/> </html> XML; $content = "<div id='main'>asdf asdf</div>"; $header = "<title>page 1</title>"; $footer = "<script type='text/javascript'></script>"; $xml = preg_replace('/<CONTENT\/>/',$content,$xml,1); $xml = preg_replace('/<HEADER\/>/',$header,$xml,1); $xml = preg_replace('/<FOOTER\/>/',$footer,$xml,1); echo $xml;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BXvOb
function name:  (null)
number of ops:  27
compiled vars:  !0 = $xml, !1 = $content, !2 = $header, !3 = $footer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%3Chead%3E%3CHEADER%2F%3E%3C%2Fhead%3E%0A%3Cbody%3E%0A%3CCONTENT%2F%3E%0A%3C%2Fbody%3E%0A%3CFOOTER%2F%3E%0A%3C%2Fhtml%3E'
   11     1        ASSIGN                                                   !1, '%3Cdiv+id%3D%27main%27%3Easdf+asdf%3C%2Fdiv%3E'
   12     2        ASSIGN                                                   !2, '%3Ctitle%3Epage+1%3C%2Ftitle%3E'
   13     3        ASSIGN                                                   !3, '%3Cscript+type%3D%27text%2Fjavascript%27%3E%3C%2Fscript%3E'
   14     4        INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F%3CCONTENT%5C%2F%3E%2F'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !0, $8
   16    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2F%3CHEADER%5C%2F%3E%2F'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !0, $10
   18    18        INIT_FCALL                                               'preg_replace'
         19        SEND_VAL                                                 '%2F%3CFOOTER%5C%2F%3E%2F'
         20        SEND_VAR                                                 !3
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 1
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !0, $12
   20    25        ECHO                                                     !0
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.65 ms | 1395 KiB | 15 Q