3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pascal($i,$j) { //$i la ligne et $j la colonne du triangle if($j==1 OR $i==$j-1) return 1; else { $coeff= pascal($i-1,$j) + pascal($i-1,$j-1); return $coeff; } } echo pascal(1,5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/79KMh
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'pascal'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 5
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function pascal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/79KMh
function name:  pascal
number of ops:  25
compiled vars:  !0 = $i, !1 = $j, !2 = $coeff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        IS_EQUAL                                         ~3      !1, 1
          3      > JMPNZ_EX                                         ~3      ~3, ->7
          4    >   SUB                                              ~4      !1, 1
          5        IS_EQUAL                                         ~5      !0, ~4
          6        BOOL                                             ~3      ~5
          7    > > JMPZ                                                     ~3, ->10
          8    > > RETURN                                                   1
          9*       JMP                                                      ->24
    9    10    >   INIT_FCALL_BY_NAME                                       'pascal'
         11        SUB                                              ~6      !0, 1
         12        SEND_VAL_EX                                              ~6
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $7      
         15        INIT_FCALL_BY_NAME                                       'pascal'
         16        SUB                                              ~8      !0, 1
         17        SEND_VAL_EX                                              ~8
         18        SUB                                              ~9      !1, 1
         19        SEND_VAL_EX                                              ~9
         20        DO_FCALL                                      0  $10     
         21        ADD                                              ~11     $7, $10
         22        ASSIGN                                                   !2, ~11
   10    23      > RETURN                                                   !2
   12    24*     > RETURN                                                   null

End of function pascal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.44 ms | 1399 KiB | 14 Q