3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '<div id="_ftn88"> <p class="FootnoteText" style="text-align:left"> <a href="#_ftnref88"><span class="FootnoteReference" style="font-family:\'Times New Roman\'; font-size:8pt">[88]</span></a><span style="font-family:\'Times New Roman\'; font-size:10pt"> </span><span style="width:7.86pt; text-indent:0pt; display:inline-block"></span><span style="font-family:\'Times New Roman\'; font-size:10pt">At 96.</span> </p> </div>'; preg_replace_callback( "/<p(.*?)>(.*?)<\/p>/s", "replaceMatches", $text); function replaceMatches($matches) { // as usual: $matches[0] is the complete match // $matches[1] the match for the first subpattern // enclosed in '(...)' and so on $matches[2] = str_replace('span', 'strong', $matches[2]); return $matches; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pM3hT
function name:  (null)
number of ops:  7
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '%3Cdiv+id%3D%22_ftn88%22%3E%0A%09%09%09%3Cp+class%3D%22FootnoteText%22+style%3D%22text-align%3Aleft%22%3E%0A%09%09%09%09%3Ca+href%3D%22%23_ftnref88%22%3E%3Cspan+class%3D%22FootnoteReference%22+style%3D%22font-family%3A%27Times+New+Roman%27%3B+font-size%3A8pt%22%3E%5B88%5D%3C%2Fspan%3E%3C%2Fa%3E%3Cspan+style%3D%22font-family%3A%27Times+New+Roman%27%3B+font-size%3A10pt%22%3E+%3C%2Fspan%3E%3Cspan+style%3D%22width%3A7.86pt%3B+text-indent%3A0pt%3B+display%3Ainline-block%22%3E%3C%2Fspan%3E%3Cspan+style%3D%22font-family%3A%27Times+New+Roman%27%3B+font-size%3A10pt%22%3EAt+96.%3C%2Fspan%3E%0A%09%09%09%3C%2Fp%3E%0A%09%09%3C%2Fdiv%3E'
   10     1        INIT_FCALL                                               'preg_replace_callback'
   11     2        SEND_VAL                                                 '%2F%3Cp%28.%2A%3F%29%3E%28.%2A%3F%29%3C%5C%2Fp%3E%2Fs'
   12     3        SEND_VAL                                                 'replaceMatches'
   13     4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
   22     6      > RETURN                                                   1

Function replacematches:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pM3hT
function name:  replaceMatches
number of ops:  11
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 'span'
          3        SEND_VAL                                                 'strong'
          4        FETCH_DIM_R                                      ~2      !0, 2
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        ASSIGN_DIM                                               !0, 2
          8        OP_DATA                                                  $3
   21     9      > RETURN                                                   !0
   22    10*     > RETURN                                                   null

End of function replacematches

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.43 ms | 1387 KiB | 17 Q