3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/<td.*?>.*?<p>(.*?)<\/p>.*?<\/td>/s'; $str = '<table width="652"> <tbody> <tr> <td colspan="2" width="652"> <p><strong>Test header</strong></p> </td> </tr> <tr> <td width="21"> <p>Nr.</p> </td> <td width="178"> <p><strong>Test2</strong></p> </td> </tr> <tr> <td rowspan="2" width="21"> <p>1</p> </td> <td rowspan="2" width="178"> <p>Test3</p> </td> </tr> </tbody> </table>'; $subst = '<td>$1</td>'; Echo "before: \n"; Var_dump($str); Echo "\n\nafter:\n"; $result = preg_replace($re, $subst, $str); Var_dump($result); //echo "The result of the substitution is ".$result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OcZ68
function name:  (null)
number of ops:  15
compiled vars:  !0 = $re, !1 = $str, !2 = $subst, !3 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2F%3Ctd.%2A%3F%3E.%2A%3F%3Cp%3E%28.%2A%3F%29%3C%5C%2Fp%3E.%2A%3F%3C%5C%2Ftd%3E%2Fs'
    4     1        ASSIGN                                                       !1, '%3Ctable+width%3D%22652%22%3E%0A%3Ctbody%3E%0A%3Ctr%3E%0A%3Ctd+colspan%3D%222%22+width%3D%22652%22%3E%0A%3Cp%3E%3Cstrong%3ETest+header%3C%2Fstrong%3E%3C%2Fp%3E%0A%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A%3Ctr%3E%0A%3Ctd+width%3D%2221%22%3E%0A%3Cp%3ENr.%3C%2Fp%3E%0A%3C%2Ftd%3E%0A%3Ctd+width%3D%22178%22%3E%0A%3Cp%3E%3Cstrong%3ETest2%3C%2Fstrong%3E%3C%2Fp%3E%0A%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A%3Ctr%3E%0A%3Ctd+rowspan%3D%222%22+width%3D%2221%22%3E%0A%3Cp%3E1%3C%2Fp%3E%0A%3C%2Ftd%3E%0A%3Ctd+rowspan%3D%222%22+width%3D%22178%22%3E%0A%3Cp%3ETest3%3C%2Fp%3E%0A%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A%3C%2Ftbody%3E%0A%3C%2Ftable%3E'
   29     2        ASSIGN                                                       !2, '%3Ctd%3E%241%3C%2Ftd%3E'
   30     3        ECHO                                                         'before%3A+%0A'
   31     4        INIT_FCALL                                                   'var_dump'
          5        SEND_VAR                                                     !1
          6        DO_ICALL                                                     
   32     7        ECHO                                                         '%0A%0Aafter%3A%0A'
   33     8        FRAMELESS_ICALL_3                preg_replace        ~8      !0, !2
          9        OP_DATA                                                      !1
         10        ASSIGN                                                       !3, ~8
   34    11        INIT_FCALL                                                   'var_dump'
         12        SEND_VAR                                                     !3
         13        DO_ICALL                                                     
   36    14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.96 ms | 2239 KiB | 14 Q