3v4l.org

run code in 500+ PHP versions simultaneously
<?php $reg_exp = "/(^<table.+.(?:[n])?(?:.+)?)(<tbody>)/s"; $replace_with = '$1<thead>'; $input = '<table class="table table-bordered table-responsive" style="width: 100%;"> <tbody>'; $final = preg_replace($reg_exp, $replace_with, $input); var_dump($final);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/srNiQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $reg_exp, !1 = $replace_with, !2 = $input, !3 = $final
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%2F%28%5E%3Ctable.%2B.%28%3F%3A%5Bn%5D%29%3F%28%3F%3A.%2B%29%3F%29%28%3Ctbody%3E%29%2Fs'
    3     1        ASSIGN                                                       !1, '%241%3Cthead%3E'
    4     2        ASSIGN                                                       !2, '%3Ctable+class%3D%22table+table-bordered+table-responsive%22+style%3D%22width%3A+100%25%3B%22%3E%0A%3Ctbody%3E'
    6     3        FRAMELESS_ICALL_3                preg_replace        ~7      !0, !1
          4        OP_DATA                                                      !2
          5        ASSIGN                                                       !3, ~7
    8     6        INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !3
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.1 ms | 2189 KiB | 14 Q