3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reg = '#<p>\s*\[spoiler\s+id=\d+\]\s*</p>#'; $text = <<<TEXT Before. <p> [spoiler id=7] </p> After. <p> [spoiler id=42] </p> TEXT; echo preg_replace($reg, '', $text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HJ9rg
function name:  (null)
number of ops:  9
compiled vars:  !0 = $reg, !1 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%23%3Cp%3E%5Cs%2A%5C%5Bspoiler%5Cs%2Bid%3D%5Cd%2B%5C%5D%5Cs%2A%3C%2Fp%3E%23'
    5     1        ASSIGN                                                   !1, '+Before.%0A+%3Cp%3E%0A+++%5Bspoiler+id%3D7%5D%0A+%3C%2Fp%3E%0A+After.%0A+%3Cp%3E%0A+++%5Bspoiler++++++id%3D42%5D%0A+%3C%2Fp%3E%0A'
   17     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.04 ms | 1398 KiB | 15 Q