If a menu contains an item whose label is an integer,
then menu index returns the value of that menu item,
or if the integer is too large, then it returns
the index of the last item in the menu.

Here is a procedure to see this.
Enter it into wish and select menu items to see the index.
The index of entry "3" is reported as 3, but should be 1.

menubutton .mb -m .mb.menu -text testmenu
pack .mb
set m [menu .mb.menu]
$m add command -label foo -command {puts "foo: [$m index foo]"}
$m add command -label 3 -command {puts "3: [$m index 3]"}
$m add command -label 3a -command {puts "3: [$m index 3a]"}
$m add command -label bar -command {puts "bar: [$m index bar]"}
$m add command -label baz -command {puts "baz: [$m index baz]"}

I saw this on ActiveState Aqua Tcl/Tk 8.4.13 on MacOS X 10.4.7. I have
not tried to duplicate it on other operating systems nor with 8.4.14
(since the ActiveState version is not yet available).

Proposal for a fix in the documentation in branch bug-1581435fff

A test case has also been augmented to check the precedence order in the matching process of the index string.