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); } return $input . str_repeat('o', 12 - $length); } 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/0ovOb
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'dumb'
          1        SEND_VAL                                                 'aaaaaaaaaaaaaaaaaaaa'
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%0A'
          4        ECHO                                                     ~1
   15     5        INIT_FCALL                                               'dumb'
          6        SEND_VAL                                                 'aaaaaaa'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      $2, '%0A'
          9        ECHO                                                     ~3
   16    10      > 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 = 62) Position 1 = -2
filename:       /in/0ovOb
function name:  dumb
number of ops:  24
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    >   INIT_FCALL                                               'str_repeat'
         15        SEND_VAL                                                 'o'
         16        SUB                                              ~6      12, !1
         17        SEND_VAL                                                 ~6
         18        DO_ICALL                                         $7      
         19        CONCAT                                           ~8      !0, $7
         20        VERIFY_RETURN_TYPE                                       ~8
         21      > RETURN                                                   ~8
   12    22*       VERIFY_RETURN_TYPE                                       
         23*     > RETURN                                                   null

End of function dumb

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.21 ms | 1399 KiB | 21 Q