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); } while (mb_strlen($input) < 1000000) { $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/59mRU
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'dumb'
          1        SEND_VAL                                                 'aaaaaaa'
          2        DO_FCALL                                      0          
   22     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 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 15
Branch analysis from position: 21
Branch analysis from position: 15
filename:       /in/59mRU
function name:  dumb
number of ops:  25
compiled vars:  !0 = $input, !1 = $length
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                                         $2      
          4        ASSIGN                                                   !1, $2
    7     5        IS_SMALLER                                               10, !1
          6      > JMPZ                                                     ~4, ->14
    8     7    >   INIT_FCALL                                               'mb_substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 6
         11        DO_ICALL                                         $5      
         12        VERIFY_RETURN_TYPE                                       $5
         13      > RETURN                                                   $5
   11    14    > > JMP                                                      ->16
   12    15    >   ASSIGN_OP                                     8          !0, 'o'
   11    16    >   INIT_FCALL                                               'mb_strlen'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $7      
         19        IS_SMALLER                                               $7, 1000000
         20      > JMPNZ                                                    ~8, ->15
   15    21    >   VERIFY_RETURN_TYPE                                       !0
         22      > RETURN                                                   !0
   16    23*       VERIFY_RETURN_TYPE                                       
         24*     > RETURN                                                   null

End of function dumb

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136 ms | 1399 KiB | 18 Q