3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=62476 function factorial($i){ return ($i==1)?1:$i*factorial($i-1); } $a = array(); for ($d=1; $d<10; $d++) { $a[$d] = $d; } foreach($a as $b => $c){ echo "\$a[$b] == " . factorial($c) . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/4gpq0
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $d, !2 = $c, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->6
   11     3    >   ASSIGN_DIM                                               !0, !1
          4        OP_DATA                                                  !1
    9     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, 10
          7      > JMPNZ                                                    ~8, ->3
   13     8    > > FE_RESET_R                                       $9      !0, ->21
          9    > > FE_FETCH_R                                       ~10     $9, !2, ->21
         10    >   ASSIGN                                                   !3, ~10
   14    11        ROPE_INIT                                     3  ~13     '%24a%5B'
         12        ROPE_ADD                                      1  ~13     ~13, !3
         13        ROPE_END                                      2  ~12     ~13, '%5D+%3D%3D+'
         14        INIT_FCALL                                               'factorial'
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0  $15     
         17        CONCAT                                           ~16     ~12, $15
         18        CONCAT                                           ~17     ~16, '%0A'
         19        ECHO                                                     ~17
   13    20      > JMP                                                      ->9
         21    >   FE_FREE                                                  $9
   15    22      > RETURN                                                   1

Function factorial:
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 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4gpq0
function name:  factorial
number of ops:  13
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        IS_EQUAL                                                 !0, 1
          2      > JMPZ                                                     ~1, ->5
          3    >   QM_ASSIGN                                        ~2      1
          4      > JMP                                                      ->11
          5    >   INIT_FCALL_BY_NAME                                       'factorial'
          6        SUB                                              ~3      !0, 1
          7        SEND_VAL_EX                                              ~3
          8        DO_FCALL                                      0  $4      
          9        MUL                                              ~5      !0, $4
         10        QM_ASSIGN                                        ~2      ~5
         11    > > RETURN                                                   ~2
    6    12*     > RETURN                                                   null

End of function factorial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.96 ms | 1403 KiB | 14 Q