3v4l.org

run code in 300+ PHP versions simultaneously
<?php function num( $a, $b ) { if ( 0 == $b ) { return $a; } if ( $a > $b ) { $a = $a - $b; } else { $b = $b - $a; } return num( $a, $b ); } echo num( 66, 6 ); echo num( 24, 4 ); echo num( 99, 3 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L9JXh
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'num'
          1        SEND_VAL                                                 66
          2        SEND_VAL                                                 6
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
   22     5        INIT_FCALL                                               'num'
          6        SEND_VAL                                                 24
          7        SEND_VAL                                                 4
          8        DO_FCALL                                      0  $1      
          9        ECHO                                                     $1
   23    10        INIT_FCALL                                               'num'
         11        SEND_VAL                                                 99
         12        SEND_VAL                                                 3
         13        DO_FCALL                                      0  $2      
         14        ECHO                                                     $2
         15      > RETURN                                                   1

Function num:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
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: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L9JXh
function name:  num
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        IS_EQUAL                                                 !1, 0
          3      > JMPZ                                                     ~2, ->5
    6     4    > > RETURN                                                   !0
    9     5    >   IS_SMALLER                                               !1, !0
          6      > JMPZ                                                     ~3, ->10
   11     7    >   SUB                                              ~4      !0, !1
          8        ASSIGN                                                   !0, ~4
          9      > JMP                                                      ->12
   15    10    >   SUB                                              ~6      !1, !0
         11        ASSIGN                                                   !1, ~6
   18    12    >   INIT_FCALL_BY_NAME                                       'num'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $8      
         16      > RETURN                                                   $8
   19    17*     > RETURN                                                   null

End of function num

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.58 ms | 1399 KiB | 16 Q