3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fact($n) { return $n == 0 ? 1 : ($n==1 ? 1 : $n * fact($n - 1)) ; } echo fact(5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t45pF
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'fact'
          1        SEND_VAL                                                 5
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function fact:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t45pF
function name:  fact
number of ops:  18
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                                 !0, 0
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      1
          4      > JMP                                                      ->16
          5    >   IS_EQUAL                                                 !0, 1
          6      > JMPZ                                                     ~3, ->9
          7    >   QM_ASSIGN                                        ~4      1
          8      > JMP                                                      ->15
          9    >   INIT_FCALL_BY_NAME                                       'fact'
         10        SUB                                              ~5      !0, 1
         11        SEND_VAL_EX                                              ~5
         12        DO_FCALL                                      0  $6      
         13        MUL                                              ~7      !0, $6
         14        QM_ASSIGN                                        ~4      ~7
         15    >   QM_ASSIGN                                        ~2      ~4
         16    > > RETURN                                                   ~2
    5    17*     > RETURN                                                   null

End of function fact

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.65 ms | 1399 KiB | 14 Q