3v4l.org

run code in 300+ 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/bZAKI
function name:  (null)
number of ops:  13
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, '%2F1%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        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.69 ms | 1394 KiB | 17 Q