3v4l.org

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

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

End of function callback

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.42 ms | 1395 KiB | 21 Q