3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get($l, $c) { $value = 0; if (0 <= $c && $c <= $l && $l < 5000) { $tab = []; for ($i = 0; $i <= $l; $i++) { for ($j = 0; $j <= $c; $j++) { if ($i == $j || $i - 1 <= 0 || $j <= 0) { $tab[$i][$j] = 1; $value = $tab[$i][$j]; } elseif ($i != $j) { $tab[$i][$j] = bcadd($tab[$i - 1][$j - 1], $tab[$i - 1][$j]); $value = $tab[$i][$j]; } } } } return $value; } $result = get(67, 34); var_dump($result == '14226520737620288370'); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZOi6
function name:  (null)
number of ops:  11
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'get'
          1        SEND_VAL                                                 67
          2        SEND_VAL                                                 34
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   28     5        INIT_FCALL                                               'var_dump'
          6        IS_EQUAL                                         ~3      !0, '14226520737620288370'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   29     9        ECHO                                                     !0
   30    10      > RETURN                                                   1

Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 59
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 14
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 16
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 14
Branch analysis from position: 59
Branch analysis from position: 14
Branch analysis from position: 16
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 47) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 16
Branch analysis from position: 56
Branch analysis from position: 16
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 53
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 16
Branch analysis from position: 56
Branch analysis from position: 16
Branch analysis from position: 53
Branch analysis from position: 24
Branch analysis from position: 21
Branch analysis from position: 59
Branch analysis from position: 10
Branch analysis from position: 7
filename:       /in/BZOi6
function name:  get
number of ops:  61
compiled vars:  !0 = $l, !1 = $c, !2 = $value, !3 = $tab, !4 = $i, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, 0
    7     3        IS_SMALLER_OR_EQUAL                              ~7      0, !1
          4      > JMPZ_EX                                          ~7      ~7, ->7
          5    >   IS_SMALLER_OR_EQUAL                              ~8      !1, !0
          6        BOOL                                             ~7      ~8
          7    > > JMPZ_EX                                          ~7      ~7, ->10
          8    >   IS_SMALLER                                       ~9      !0, 5000
          9        BOOL                                             ~7      ~9
         10    > > JMPZ                                                     ~7, ->59
    8    11    >   ASSIGN                                                   !3, <array>
   10    12        ASSIGN                                                   !4, 0
         13      > JMP                                                      ->57
   12    14    >   ASSIGN                                                   !5, 0
         15      > JMP                                                      ->54
   14    16    >   IS_EQUAL                                         ~13     !4, !5
         17      > JMPNZ_EX                                         ~13     ~13, ->21
         18    >   SUB                                              ~14     !4, 1
         19        IS_SMALLER_OR_EQUAL                              ~15     ~14, 0
         20        BOOL                                             ~13     ~15
         21    > > JMPNZ_EX                                         ~13     ~13, ->24
         22    >   IS_SMALLER_OR_EQUAL                              ~16     !5, 0
         23        BOOL                                             ~13     ~16
         24    > > JMPZ                                                     ~13, ->32
   15    25    >   FETCH_DIM_W                                      $17     !3, !4
         26        ASSIGN_DIM                                               $17, !5
         27        OP_DATA                                                  1
   16    28        FETCH_DIM_R                                      ~19     !3, !4
         29        FETCH_DIM_R                                      ~20     ~19, !5
         30        ASSIGN                                                   !2, ~20
   14    31      > JMP                                                      ->53
   17    32    >   IS_NOT_EQUAL                                             !4, !5
         33      > JMPZ                                                     ~22, ->53
   18    34    >   INIT_FCALL_BY_NAME                                       'bcadd'
         35        CHECK_FUNC_ARG                                           
         36        SUB                                              ~25     !4, 1
         37        SUB                                              ~27     !5, 1
         38        FETCH_DIM_FUNC_ARG                               $26     !3, ~25
         39        FETCH_DIM_FUNC_ARG                               $28     $26, ~27
         40        SEND_FUNC_ARG                                            $28
         41        CHECK_FUNC_ARG                                           
         42        SUB                                              ~29     !4, 1
         43        FETCH_DIM_FUNC_ARG                               $30     !3, ~29
         44        FETCH_DIM_FUNC_ARG                               $31     $30, !5
         45        SEND_FUNC_ARG                                            $31
         46        DO_FCALL                                      0  $32     
         47        FETCH_DIM_W                                      $23     !3, !4
         48        ASSIGN_DIM                                               $23, !5
         49        OP_DATA                                                  $32
   19    50        FETCH_DIM_R                                      ~33     !3, !4
         51        FETCH_DIM_R                                      ~34     ~33, !5
         52        ASSIGN                                                   !2, ~34
   12    53    >   PRE_INC                                                  !5
         54    >   IS_SMALLER_OR_EQUAL                                      !5, !1
         55      > JMPNZ                                                    ~37, ->16
   10    56    >   PRE_INC                                                  !4
         57    >   IS_SMALLER_OR_EQUAL                                      !4, !0
         58      > JMPNZ                                                    ~39, ->14
   24    59    > > RETURN                                                   !2
   25    60*     > RETURN                                                   null

End of function get

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.87 ms | 1016 KiB | 15 Q