3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo factorial(3); function factorial(int $extent, int $currentValue = 1, int $step = 1): int { $currentValue *= $step; if ($step < $extent) { $step++; return factorial($extent, $step); } return $currentValue; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HhBs4
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'factorial'
          1        SEND_VAL_EX                                              3
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   15     4      > RETURN                                                   1

Function factorial:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HhBs4
function name:  factorial
number of ops:  17
compiled vars:  !0 = $extent, !1 = $currentValue, !2 = $step
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      1
          2        RECV_INIT                                        !2      1
    7     3        ASSIGN_OP                                     3          !1, !2
    9     4        IS_SMALLER                                               !2, !0
          5      > JMPZ                                                     ~4, ->13
   10     6    >   PRE_INC                                                  !2
   11     7        INIT_FCALL_BY_NAME                                       'factorial'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $6      
         11        VERIFY_RETURN_TYPE                                       $6
         12      > RETURN                                                   $6
   14    13    >   VERIFY_RETURN_TYPE                                       !1
         14      > RETURN                                                   !1
   15    15*       VERIFY_RETURN_TYPE                                       
         16*     > RETURN                                                   null

End of function factorial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1394 KiB | 13 Q