3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<p id="keepthis"> text</p><div id="foo">text</div><div id="bar">more text</div><a id="red"href="page6.php">Page 6</a><a id="green"href="page7.php">Page 7</a>'; echo preg_replace_callback( '/(?<=<div|<a)( *id="[^"]+")/', function ($match) { return " "; }, $string );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcTiS
function name:  (null)
number of ops:  9
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cp+id%3D%22keepthis%22%3E+text%3C%2Fp%3E%3Cdiv+id%3D%22foo%22%3Etext%3C%2Fdiv%3E%3Cdiv+id%3D%22bar%22%3Emore+text%3C%2Fdiv%3E%3Ca+id%3D%22red%22href%3D%22page6.php%22%3EPage+6%3C%2Fa%3E%3Ca+id%3D%22green%22href%3D%22page7.php%22%3EPage+7%3C%2Fa%3E'
    5     1        INIT_FCALL                                               'preg_replace_callback'
    6     2        SEND_VAL                                                 '%2F%28%3F%3C%3D%3Cdiv%7C%3Ca%29%28+%2Aid%3D%22%5B%5E%22%5D%2B%22%29%2F'
    7     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   10     4        SEND_VAL                                                 ~2
   11     5        SEND_VAR                                                 !0
    5     6        DO_ICALL                                         $3      
   11     7        ECHO                                                     $3
   12     8      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lcTiS
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1      > RETURN                                                   '+'
   10     2*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.68 ms | 997 KiB | 14 Q