3v4l.org

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

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

End of function factorial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.7 ms | 1398 KiB | 16 Q