3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '/(<table id="table-[0-9]+">[\s]+<tbody>[\s]+<tr><td><p>\{\{Phrase (1|2)\}\}<\/p><\/td><\/tr>[\s]+<\/tbody>[\s]+<\/table>)/'; $html = '<table id="table-1"> <tbody> <tr><td><p>{{Phrase 1}}</p></td></tr> </tbody> </table> <table id="table-2"> <tbody> <tr><td><p>Sample text 1 goes here..</p></td></tr> </tbody> </table> <table id="table-3"> <tbody> <tr><td><p>{{Phrase 2}}</p></td></tr> </tbody> </table> <table id="table-4"> <tbody> <tr><td><p>Sample text 2 goes here..</p></td></tr> </tbody> </table>'; $clean = preg_replace($regex, '', $html); echo $clean;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4QHvm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $regex, !1 = $html, !2 = $clean
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%28%3Ctable+id%3D%22table-%5B0-9%5D%2B%22%3E%5B%5Cs%5D%2B%3Ctbody%3E%5B%5Cs%5D%2B%3Ctr%3E%3Ctd%3E%3Cp%3E%5C%7B%5C%7BPhrase+%281%7C2%29%5C%7D%5C%7D%3C%5C%2Fp%3E%3C%5C%2Ftd%3E%3C%5C%2Ftr%3E%5B%5Cs%5D%2B%3C%5C%2Ftbody%3E%5B%5Cs%5D%2B%3C%5C%2Ftable%3E%29%2F'
    5     1        ASSIGN                                                   !1, '%3Ctable+id%3D%22table-1%22%3E%0A++++%3Ctbody%3E%0A++++++++%3Ctr%3E%3Ctd%3E%3Cp%3E%7B%7BPhrase+1%7D%7D%3C%2Fp%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A++++%3C%2Ftbody%3E%0A%3C%2Ftable%3E%0A%3Ctable+id%3D%22table-2%22%3E%0A++++%3Ctbody%3E%0A++++++++%3Ctr%3E%3Ctd%3E%3Cp%3ESample+text+1+goes+here..%3C%2Fp%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A++++%3C%2Ftbody%3E%0A%3C%2Ftable%3E%0A%3Ctable+id%3D%22table-3%22%3E%0A++++%3Ctbody%3E%0A++++++++%3Ctr%3E%3Ctd%3E%3Cp%3E%7B%7BPhrase+2%7D%7D%3C%2Fp%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A++++%3C%2Ftbody%3E%0A%3C%2Ftable%3E%0A%3Ctable+id%3D%22table-4%22%3E%0A++++%3Ctbody%3E%0A++++++++%3Ctr%3E%3Ctd%3E%3Cp%3ESample+text+2+goes+here..%3C%2Fp%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A++++%3C%2Ftbody%3E%0A%3C%2Ftable%3E'
   26     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   28     8        ECHO                                                     !2
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.94 ms | 1010 KiB | 14 Q