3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = '<div class="wrap"> <div class="wp-checkbox" data-value="zf">content</div> <div class="wp-checkbox" data-value="tdp">content</div> </div>'; $pattern = '/=\"zf\">.*?<\/div>/'; $pattern2 = '/=\"tdp\">.*?<\/div>/'; $html = preg_replace( $pattern, '="zf">new content of div</div>', $html ); $html = preg_replace( $pattern2, '="tdp">new content of another div</div>', $html ); echo $html;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jRjIB
function name:  (null)
number of ops:  11
compiled vars:  !0 = $html, !1 = $pattern, !2 = $pattern2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cdiv+class%3D%22wrap%22%3E%0A%3Cdiv+class%3D%22wp-checkbox%22+data-value%3D%22zf%22%3Econtent%3C%2Fdiv%3E%0A%3Cdiv+class%3D%22wp-checkbox%22+data-value%3D%22tdp%22%3Econtent%3C%2Fdiv%3E%0A%3C%2Fdiv%3E'
    8     1        ASSIGN                                                       !1, '%2F%3D%5C%22zf%5C%22%3E.%2A%3F%3C%5C%2Fdiv%3E%2F'
    9     2        ASSIGN                                                       !2, '%2F%3D%5C%22tdp%5C%22%3E.%2A%3F%3C%5C%2Fdiv%3E%2F'
   10     3        FRAMELESS_ICALL_3                preg_replace        ~6      !1, '%3D%22zf%22%3Enew+content+of+div%3C%2Fdiv%3E'
          4        OP_DATA                                                      !0
          5        ASSIGN                                                       !0, ~6
   11     6        FRAMELESS_ICALL_3                preg_replace        ~8      !2, '%3D%22tdp%22%3Enew+content+of+another+div%3C%2Fdiv%3E'
          7        OP_DATA                                                      !0
          8        ASSIGN                                                       !0, ~8
   13     9        ECHO                                                         !0
   14    10      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
293.85 ms | 2255 KiB | 13 Q