3v4l.org

run code in 300+ PHP versions simultaneously
<?php function variations($length, $chars) { $unique_chars = count_chars($chars, 3); if ($length <= 0 || $unique_chars <= 0) return 0; $additional = ($length > 1) ? variations($length - 1, $chars) : 0; return pow($unique_chars, $length) + $additional; } echo variations(10, 26);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LBALH
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'variations'
          1        SEND_VAL                                                 10
          2        SEND_VAL                                                 26
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function variations:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/LBALH
function name:  variations
number of ops:  31
compiled vars:  !0 = $length, !1 = $chars, !2 = $unique_chars, !3 = $additional
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'count_chars'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !2, $4
    5     7        IS_SMALLER_OR_EQUAL                              ~6      !0, 0
          8      > JMPNZ_EX                                         ~6      ~6, ->11
          9    >   IS_SMALLER_OR_EQUAL                              ~7      !2, 0
         10        BOOL                                             ~6      ~7
         11    > > JMPZ                                                     ~6, ->13
         12    > > RETURN                                                   0
    6    13    >   IS_SMALLER                                               1, !0
         14      > JMPZ                                                     ~8, ->22
         15    >   INIT_FCALL_BY_NAME                                       'variations'
         16        SUB                                              ~9      !0, 1
         17        SEND_VAL_EX                                              ~9
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0  $10     
         20        QM_ASSIGN                                        ~11     $10
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~11     0
         23    >   ASSIGN                                                   !3, ~11
    7    24        INIT_FCALL                                               'pow'
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $13     
         28        ADD                                              ~14     $13, !3
         29      > RETURN                                                   ~14
    8    30*     > RETURN                                                   null

End of function variations

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
377.29 ms | 1394 KiB | 19 Q