3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myFunc($n) { $i = 1; $x = 0; if($n < 0) return 0; else { while($i <= $n) $i = $i * 10; $i = $i / 10; $x = $n % 10; } return ( $x * $i + myFunc($n / 10)); } echo myFunc(86403);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cU2bS
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'myfunc'
          1        SEND_VAL                                                 86403
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function myfunc:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 8
Branch analysis from position: 12
Branch analysis from position: 8
filename:       /in/cU2bS
function name:  myFunc
number of ops:  24
compiled vars:  !0 = $n, !1 = $i, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 1
    5     2        ASSIGN                                                   !2, 0
    7     3        IS_SMALLER                                               !0, 0
          4      > JMPZ                                                     ~5, ->7
    8     5    > > RETURN                                                   0
          6*       JMP                                                      ->16
   12     7    > > JMP                                                      ->10
   13     8    >   MUL                                              ~6      !1, 10
          9        ASSIGN                                                   !1, ~6
   12    10    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         11      > JMPNZ                                                    ~8, ->8
   15    12    >   DIV                                              ~9      !1, 10
         13        ASSIGN                                                   !1, ~9
   16    14        MOD                                              ~11     !0, 10
         15        ASSIGN                                                   !2, ~11
   19    16        MUL                                              ~13     !2, !1
         17        INIT_FCALL_BY_NAME                                       'myFunc'
         18        DIV                                              ~14     !0, 10
         19        SEND_VAL_EX                                              ~14
         20        DO_FCALL                                      0  $15     
         21        ADD                                              ~16     ~13, $15
         22      > RETURN                                                   ~16
   20    23*     > RETURN                                                   null

End of function myfunc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.69 ms | 1399 KiB | 14 Q