3v4l.org

run code in 300+ PHP versions simultaneously
<?php $factorial = null; $factorial = function ($n) use (&$factorial) { return $n == 0 ? 1 : $factorial($n-1) * $n; }; echo $factorial(10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rMm35
function name:  (null)
number of ops:  9
compiled vars:  !0 = $factorial
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrMm35%3A4%240'
          2        BIND_LEXICAL                                             ~2, !0
          3        ASSIGN                                                   !0, ~2
    5     4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              10
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FrMm35%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rMm35
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $n, !1 = $factorial
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        IS_EQUAL                                                 !0, 0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      1
          5      > JMP                                                      ->12
          6    >   INIT_DYNAMIC_CALL                                        !1
          7        SUB                                              ~4      !0, 1
          8        SEND_VAL_EX                                              ~4
          9        DO_FCALL                                      0  $5      
         10        MUL                                              ~6      !0, $5
         11        QM_ASSIGN                                        ~3      ~6
         12    > > RETURN                                                   ~3
         13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FrMm35%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.7 ms | 1385 KiB | 13 Q