3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "####KELLY##### and ###ANOTHER###### not ####foo#### but: ###SHARE###MIDDLE###HASHES### ?"; echo $str . "\n"; echo preg_replace_callback( '/#{3}\K[A-Z]+(?=#{3})/', function($m) { return str_repeat('#', strlen($m[0])); }, $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eIlA0
function name:  (null)
number of ops:  11
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        INIT_FCALL                                               'preg_replace_callback'
    6     4        SEND_VAL                                                 '%2F%23%7B3%7D%5CK%5BA-Z%5D%2B%28%3F%3D%23%7B3%7D%29%2F'
    7     5        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
    9     6        SEND_VAL                                                 ~3
   10     7        SEND_VAR                                                 !0
    5     8        DO_ICALL                                         $4      
   10     9        ECHO                                                     $4
   11    10      > 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/eIlA0
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'str_repeat'
          2        SEND_VAL                                                 '%23'
          3        FETCH_DIM_R                                      ~1      !0, 0
          4        STRLEN                                           ~2      ~1
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
    9     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.83 ms | 1001 KiB | 15 Q