3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dumb(string $input): string { $length = mb_strlen($input); if ($length > 10) { return mb_substr($input, 0, 6); } $newSymbols = 1000000 - $length; for ($i = 0; $i < $newSymbols; $i++) { $input .= 'o'; } return $input; } dumb('aaaaaaa'); // echo dumb('aaaaaaaaaaaaaaaaaaaa') . PHP_EOL; // echo dumb('aaaaaaa') . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qr6sY
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'dumb'
          1        SEND_VAL                                                 'aaaaaaa'
          2        DO_FCALL                                      0          
   24     3      > RETURN                                                   1

Function dumb:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 18
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 18
Branch analysis from position: 22
Branch analysis from position: 18
filename:       /in/Qr6sY
function name:  dumb
number of ops:  26
compiled vars:  !0 = $input, !1 = $length, !2 = $newSymbols, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    7     5        IS_SMALLER                                               10, !1
          6      > JMPZ                                                     ~6, ->14
    8     7    >   INIT_FCALL                                               'mb_substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 6
         11        DO_ICALL                                         $7      
         12        VERIFY_RETURN_TYPE                                       $7
         13      > RETURN                                                   $7
   11    14    >   SUB                                              ~8      1000000, !1
         15        ASSIGN                                                   !2, ~8
   13    16        ASSIGN                                                   !3, 0
         17      > JMP                                                      ->20
   14    18    >   ASSIGN_OP                                     8          !0, 'o'
   13    19        PRE_INC                                                  !3
         20    >   IS_SMALLER                                               !3, !2
         21      > JMPNZ                                                    ~13, ->18
   17    22    >   VERIFY_RETURN_TYPE                                       !0
         23      > RETURN                                                   !0
   18    24*       VERIFY_RETURN_TYPE                                       
         25*     > RETURN                                                   null

End of function dumb

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.51 ms | 1399 KiB | 18 Q