3v4l.org

run code in 500+ PHP versions simultaneously
<?php $source = '<img src="source.jpg">'; $string = '<div id="pf1" class="pf w0 h0" data-page-no="1"> <div class="pc pc1 w0 h0"> <img class="bi x0 y0 w0 h0" alt="" src="../images/cover.jpg"/> </div>'; $find = '/<img(.*?)\/>/'; echo preg_replace($find, $source, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6CYQU
function name:  (null)
number of ops:  7
compiled vars:  !0 = $source, !1 = $string, !2 = $find
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cimg+src%3D%22source.jpg%22%3E'
    4     1        ASSIGN                                                       !1, '%3Cdiv+id%3D%22pf1%22+class%3D%22pf+w0+h0%22+data-page-no%3D%221%22%3E%0A%3Cdiv+class%3D%22pc+pc1+w0+h0%22%3E%0A++%3Cimg+class%3D%22bi+x0+y0+w0+h0%22+alt%3D%22%22+src%3D%22..%2Fimages%2Fcover.jpg%22%2F%3E%0A%3C%2Fdiv%3E'
    9     2        ASSIGN                                                       !2, '%2F%3Cimg%28.%2A%3F%29%5C%2F%3E%2F'
   10     3        FRAMELESS_ICALL_3                preg_replace        ~6      !2, !0
          4        OP_DATA                                                      !1
          5        ECHO                                                         ~6
          6      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.53 ms | 2339 KiB | 13 Q