3v4l.org

run code in 300+ PHP versions simultaneously
<?php function maskString($string) { return preg_replace('/(?<=.).(?=.*)/u','*',$string); } function maskEmail($email) { $arremail = explode('@',$email); //$email1 = preg_replace('/(?<=.).(?=.*@)/u','*',$arremail[0].'@'); //$email2 = preg_replace('/(?<=.).(?=.*[.])/u','*',$arremail[1]); //return $email1.$email2; return maskString($arremail[0]); } $email = 'facebook@yahoo.co.id'; $result = maskEmail($email); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m0Fne
function name:  (null)
number of ops:  7
compiled vars:  !0 = $email, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'facebook%40yahoo.co.id'
   16     1        INIT_FCALL                                               'maskemail'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   17     5        ECHO                                                     !1
          6      > RETURN                                                   1

Function maskstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m0Fne
function name:  maskString
number of ops:  8
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%3F%3C%3D.%29.%28%3F%3D.%2A%29%2Fu'
          3        SEND_VAL                                                 '%2A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    5     7*     > RETURN                                                   null

End of function maskstring

Function maskemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m0Fne
function name:  maskEmail
number of ops:  12
compiled vars:  !0 = $email, !1 = $arremail
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%40'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !1, $2
   13     6        INIT_FCALL                                               'maskstring'
          7        FETCH_DIM_R                                      ~4      !1, 0
          8        SEND_VAL                                                 ~4
          9        DO_FCALL                                      0  $5      
         10      > RETURN                                                   $5
   14    11*     > RETURN                                                   null

End of function maskemail

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.14 ms | 1403 KiB | 19 Q