3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "####KELLY##### and ###ANOTHER###### not ####foo#### but: ###SHARE###MIDDLE###HASHES### ?"; echo $str . "\n"; echo preg_replace('/(?:#{3}|\G(?!^))\K[A-Z](?=[A-Z]*#{3})/', '#', $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FGgZb
function name:  (null)
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%23%23%23%23KELLY%23%23%23%23%23+and+%23%23%23ANOTHER%23%23%23%23%23%23+not+%23%23%23%23foo%23%23%23%23+but%3A+%23%23%23SHARE%23%23%23MIDDLE%23%23%23HASHES%23%23%23+%3F'
    4     1        CONCAT                                               ~2      !0, '%0A'
          2        ECHO                                                         ~2
    5     3        FRAMELESS_ICALL_3                preg_replace        ~3      '%2F%28%3F%3A%23%7B3%7D%7C%5CG%28%3F%21%5E%29%29%5CK%5BA-Z%5D%28%3F%3D%5BA-Z%5D%2A%23%7B3%7D%29%2F', '%23'
          4        OP_DATA                                                      !0
          5        ECHO                                                         ~3
          6      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.92 ms | 2027 KiB | 13 Q