3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = <<<HTML <tr> Fried rice with chicken, beef, prawn or vegetable. </tr> <tr> <span class="number">78. </span>KHAO PHAD SABPAROD <span class="price">£9.95</span> </tr> HTML; echo preg_replace('/<tr>((?:(?!</tr>).|[\r\n])*<span[^>]*>(?:.|[\r\n])*?)</tr>/s', '<dt>$1</dt>', $input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a3i4W
function name:  (null)
number of ops:  8
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ctr%3E%0A%09Fried+rice+with+chicken%2C+beef%2C+prawn+or+vegetable.%0A%3C%2Ftr%3E%0A%3Ctr%3E%0A%09%3Cspan+class%3D%22number%22%3E78.+%3C%2Fspan%3EKHAO+PHAD+SABPAROD%0A%09%3Cspan+class%3D%22price%22%3E%C2%A39.95%3C%2Fspan%3E%0A%3C%2Ftr%3E'
   13     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%3Ctr%3E%28%28%3F%3A%28%3F%21%3C%2Ftr%3E%29.%7C%5B%5Cr%5Cn%5D%29%2A%3Cspan%5B%5E%3E%5D%2A%3E%28%3F%3A.%7C%5B%5Cr%5Cn%5D%29%2A%3F%29%3C%2Ftr%3E%2Fs'
          3        SEND_VAL                                                 '%3Cdt%3E%241%3C%2Fdt%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.4 ms | 1394 KiB | 15 Q