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; }
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Array to string conversion in /in/pM3hT on line 10
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Warning: Array to string conversion in /in/pM3hT on line 13
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.19 - 7.0.33, 7.1.5 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Array to string conversion in /in/pM3hT on line 13
Output for 7.3.32 - 7.3.33
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.4
Notice: Array to string conversion in /in/pM3hT on line 12

preferences:
191.97 ms | 402 KiB | 294 Q