3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hideEmail($email){ $prefix = substr($email, 0, strrpos($email, '@')); $suffix = substr($email, strripos($email, '@')); $len = floor(strlen($prefix)/2); return substr($prefix,0, $len) . str_repeat('*', $len) . $suffix; } echo hideEmail('abcdljtrsjtrsjlkjk@hotmail.com'); echo hideEmail('"abc\@def"@iana.org');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sVUuf
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'hideemail'
          1        SEND_VAL                                                 'abcdljtrsjtrsjlkjk%40hotmail.com'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   11     4        INIT_FCALL                                               'hideemail'
          5        SEND_VAL                                                 '%22abc%5C%40def%22%40iana.org'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Function hideemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sVUuf
function name:  hideEmail
number of ops:  39
compiled vars:  !0 = $email, !1 = $prefix, !2 = $suffix, !3 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        INIT_FCALL                                               'strrpos'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '%40'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
    4    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        INIT_FCALL                                               'strripos'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '%40'
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !2, $8
    5    20        INIT_FCALL                                               'floor'
         21        STRLEN                                           ~10     !1
         22        DIV                                              ~11     ~10, 2
         23        SEND_VAL                                                 ~11
         24        DO_ICALL                                         $12     
         25        ASSIGN                                                   !3, $12
    7    26        INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !1
         28        SEND_VAL                                                 0
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                         $14     
         31        INIT_FCALL                                               'str_repeat'
         32        SEND_VAL                                                 '%2A'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                         $15     
         35        CONCAT                                           ~16     $14, $15
         36        CONCAT                                           ~17     ~16, !2
         37      > RETURN                                                   ~17
    8    38*     > RETURN                                                   null

End of function hideemail

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.56 ms | 1403 KiB | 25 Q