3v4l.org

run code in 500+ PHP versions simultaneously
<?php function asterisk($password) { $count = min(strlen($password), 4); $passwordAsterisk = str_repeat('*', $count) . substr($password, $count); echo $password . ' => ' . $passwordAsterisk . PHP_EOL; return $passwordAsterisk; } asterisk('abcdef'); asterisk('abc'); asterisk('');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KBrF9
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                                   'asterisk'
          1        SEND_VAL                                                     'abcdef'
          2        DO_FCALL                                          0          
   14     3        INIT_FCALL                                                   'asterisk'
          4        SEND_VAL                                                     'abc'
          5        DO_FCALL                                          0          
   15     6        INIT_FCALL                                                   'asterisk'
          7        SEND_VAL                                                     ''
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Function asterisk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KBrF9
function name:  asterisk
number of ops:  17
compiled vars:  !0 = $password, !1 = $count, !2 = $passwordAsterisk
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        STRLEN                                               ~3      !0
          2        FRAMELESS_ICALL_2                min                 ~4      ~3, 4
          3        ASSIGN                                                       !1, ~4
    6     4        INIT_FCALL                                                   'str_repeat'
          5        SEND_VAL                                                     '%2A'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                             $6      
          8        FRAMELESS_ICALL_2                substr              ~7      !0, !1
          9        CONCAT                                               ~8      $6, ~7
         10        ASSIGN                                                       !2, ~8
    8    11        CONCAT                                               ~10     !0, '+%3D%3E+'
         12        CONCAT                                               ~11     ~10, !2
         13        CONCAT                                               ~12     ~11, '%0A'
         14        ECHO                                                         ~12
   10    15      > RETURN                                                       !2
   11    16*     > RETURN                                                       null

End of function asterisk

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
229.36 ms | 2100 KiB | 17 Q