3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "pub-1885335825402893"; echo substr_replace($string, '******', -11, 6); echo "\n---\n"; echo substr_replace($string, '******', -11, -5); echo "\n---\n"; echo substr_replace($string, '******', 9, 6); echo "\n---\n"; echo substr_replace($string, '******', 9, -5); echo "\n---\n"; echo preg_replace('~\d{5}\K\d{6}~', '******', $string); echo "\n---\n"; echo preg_replace('~(?:\G(?!^)|^pub-\d{5})\K\d(?=\d{5})~', '*', $string); echo "\n---\n"; for ($offset = 9; $offset <= 14; ++$offset) { $string[$offset] = '*'; } echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 49
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 49
Branch analysis from position: 54
Branch analysis from position: 49
filename:       /in/cSkXN
function name:  (null)
number of ops:  56
compiled vars:  !0 = $string, !1 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'pub-1885335825402893'
    4     1        INIT_FCALL                                               'substr_replace'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2A%2A%2A%2A%2A%2A'
          4        SEND_VAL                                                 -11
          5        SEND_VAL                                                 6
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
    6     8        ECHO                                                     '%0A---%0A'
    8     9        INIT_FCALL                                               'substr_replace'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '%2A%2A%2A%2A%2A%2A'
         12        SEND_VAL                                                 -11
         13        SEND_VAL                                                 -5
         14        DO_ICALL                                         $4      
         15        ECHO                                                     $4
   10    16        ECHO                                                     '%0A---%0A'
   12    17        INIT_FCALL                                               'substr_replace'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 '%2A%2A%2A%2A%2A%2A'
         20        SEND_VAL                                                 9
         21        SEND_VAL                                                 6
         22        DO_ICALL                                         $5      
         23        ECHO                                                     $5
   14    24        ECHO                                                     '%0A---%0A'
   16    25        INIT_FCALL                                               'substr_replace'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 '%2A%2A%2A%2A%2A%2A'
         28        SEND_VAL                                                 9
         29        SEND_VAL                                                 -5
         30        DO_ICALL                                         $6      
         31        ECHO                                                     $6
   18    32        ECHO                                                     '%0A---%0A'
   20    33        INIT_FCALL                                               'preg_replace'
         34        SEND_VAL                                                 '%7E%5Cd%7B5%7D%5CK%5Cd%7B6%7D%7E'
         35        SEND_VAL                                                 '%2A%2A%2A%2A%2A%2A'
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                         $7      
         38        ECHO                                                     $7
   22    39        ECHO                                                     '%0A---%0A'
   24    40        INIT_FCALL                                               'preg_replace'
         41        SEND_VAL                                                 '%7E%28%3F%3A%5CG%28%3F%21%5E%29%7C%5Epub-%5Cd%7B5%7D%29%5CK%5Cd%28%3F%3D%5Cd%7B5%7D%29%7E'
         42        SEND_VAL                                                 '%2A'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $8      
         45        ECHO                                                     $8
   26    46        ECHO                                                     '%0A---%0A'
   28    47        ASSIGN                                                   !1, 9
         48      > JMP                                                      ->52
   29    49    >   ASSIGN_DIM                                               !0, !1
         50        OP_DATA                                                  '%2A'
   28    51        PRE_INC                                                  !1
         52    >   IS_SMALLER_OR_EQUAL                                      !1, 14
         53      > JMPNZ                                                    ~12, ->49
   32    54    >   ECHO                                                     !0
   33    55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.92 ms | 1016 KiB | 15 Q