3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ' <!--{hello}--> <div class="novalue"> <a>URL</a> </div> <!--{/hello}--> <!--{hello}--> <div class="novalue"> <a>URL</a> </div> <!--{/hello}--> <!--{hello}--> <div class="novalue"> <a>URL</a> </div> <!--{/hello}-->'; while(strpos($str, ' <!--{hello}-->') !== false){ $str = str_replace(" <!--{hello}-->", "<!--{hello}-->",$str); $str = str_replace(" <!--{/hello}-->", "<!--{/hello}-->",$str); } $str = str_replace(["<!--{hello}-->", "<!--{/hello}-->"], ["{hello}", "{/hello}"],$str); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 2
Branch analysis from position: 20
Branch analysis from position: 2
filename:       /in/9oGWu
function name:  (null)
number of ops:  28
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '++++%3C%21--%7Bhello%7D--%3E%0A++++%3Cdiv+class%3D%22novalue%22%3E%0A++++++++%3Ca%3EURL%3C%2Fa%3E%0A++++%3C%2Fdiv%3E%0A++++%3C%21--%7B%2Fhello%7D--%3E%0A%0A++++++++%3C%21--%7Bhello%7D--%3E%0A++++++++%3Cdiv+class%3D%22novalue%22%3E%0A++++++++++++%3Ca%3EURL%3C%2Fa%3E%0A++++++++%3C%2Fdiv%3E%0A++++++++%3C%21--%7B%2Fhello%7D--%3E%0A%0A%3C%21--%7Bhello%7D--%3E%0A%3Cdiv+class%3D%22novalue%22%3E%0A++++%3Ca%3EURL%3C%2Fa%3E%0A%3C%2Fdiv%3E%0A%3C%21--%7B%2Fhello%7D--%3E'
   22     1      > JMP                                                      ->14
   23     2    >   INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '+%3C%21--%7Bhello%7D--%3E'
          4        SEND_VAL                                                 '%3C%21--%7Bhello%7D--%3E'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        ASSIGN                                                   !0, $2
   24     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 '+%3C%21--%7B%2Fhello%7D--%3E'
         10        SEND_VAL                                                 '%3C%21--%7B%2Fhello%7D--%3E'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        ASSIGN                                                   !0, $4
   22    14    >   INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 '+%3C%21--%7Bhello%7D--%3E'
         17        DO_ICALL                                         $6      
         18        TYPE_CHECK                                  1018          $6
         19      > JMPNZ                                                    ~7, ->2
   26    20    >   INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 <array>
         22        SEND_VAL                                                 <array>
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $8      
         25        ASSIGN                                                   !0, $8
   29    26        ECHO                                                     !0
   30    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.9 ms | 1012 KiB | 15 Q