3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ccMasking($number, $maskingCharacter = 'X') { return substr($number, 0, 4) . str_repeat($maskingCharacter, strlen($number) - 8) . substr($number, -4); } dd(ccMasking('Johannes Eriksson'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aB0Zc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL_BY_NAME                                       'dd'
          1        INIT_FCALL                                               'ccmasking'
          2        SEND_VAL                                                 'Johannes+Eriksson'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR_NO_REF_EX                                       $0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function ccmasking:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aB0Zc
function name:  ccMasking
number of ops:  21
compiled vars:  !0 = $number, !1 = $maskingCharacter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'X'
    4     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 4
          6        DO_ICALL                                         $2      
          7        INIT_FCALL                                               'str_repeat'
          8        SEND_VAR                                                 !1
          9        STRLEN                                           ~3      !0
         10        SUB                                              ~4      ~3, 8
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
         13        CONCAT                                           ~6      $2, $5
         14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 -4
         17        DO_ICALL                                         $7      
         18        CONCAT                                           ~8      ~6, $7
         19      > RETURN                                                   ~8
    5    20*     > RETURN                                                   null

End of function ccmasking

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
214.15 ms | 1399 KiB | 18 Q