3v4l.org

run code in 500+ PHP versions simultaneously
<?php function isFactorial($n){ $r = $n; foreach(range(1, $n) as $divider) { $r = $r / $divider; } if($r === 1) return true; return false; } echo isFactorial(10) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Si8TL
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'isfactorial'
          1        SEND_VAL                                                     10
          2        DO_FCALL                                          0  $0      
          3        CONCAT                                               ~1      $0, '%0A'
          4        ECHO                                                         ~1
   13     5      > RETURN                                                       1

Function isfactorial:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Si8TL
function name:  isFactorial
number of ops:  17
compiled vars:  !0 = $n, !1 = $r, !2 = $divider
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
    3     1        ASSIGN                                                       !1, !0
    4     2        INIT_FCALL                                                   'range'
          3        SEND_VAL                                                     1
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $4      
          6      > FE_RESET_R                                           $5      $4, ->11
          7    > > FE_FETCH_R                                                   $5, !2, ->11
    6     8    >   DIV                                                  ~6      !1, !2
          9        ASSIGN                                                       !1, ~6
    4    10      > JMP                                                          ->7
         11    >   FE_FREE                                                      $5
    8    12        IS_IDENTICAL                                                 !1, 1
         13      > JMPZ                                                         ~8, ->15
         14    > > RETURN                                                       <true>
    9    15    > > RETURN                                                       <false>
   10    16*     > RETURN                                                       null

End of function isfactorial

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.96 ms | 1353 KiB | 15 Q