3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callback($s) { var_dump($s); return substr_replace($s[0], str_repeat('*', strlen($s[0])), 0, -4); } $values = array( '5746244234383238', '746244234383238', '46244234383238', '6244234383238', '244234383238', '44234383238', ); foreach ($values as $value) var_dump(preg_replace_callback('/\d{12,16}/', 'callback', $value));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/nhvuB
function name:  (null)
number of ops:  14
compiled vars:  !0 = $values, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   17     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                               $3, !1, ->12
   18     3    >   INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'preg_replace_callback'
          5        SEND_VAL                                                 '%2F%5Cd%7B12%2C16%7D%2F'
          6        SEND_VAL                                                 'callback'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
   17    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
   18    13      > RETURN                                                   1

Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nhvuB
function name:  callback
number of ops:  19
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'substr_replace'
          5        FETCH_DIM_R                                      ~2      !0, 0
          6        SEND_VAL                                                 ~2
          7        INIT_FCALL                                               'str_repeat'
          8        SEND_VAL                                                 '%2A'
          9        FETCH_DIM_R                                      ~3      !0, 0
         10        STRLEN                                           ~4      ~3
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 -4
         16        DO_ICALL                                         $6      
         17      > RETURN                                                   $6
    6    18*     > RETURN                                                   null

End of function callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.75 ms | 1396 KiB | 21 Q