From the declare section of man bash:
-i The variable is treated as an integer; arithmetic evaluation (see ARITHMETIC EVALUATION) is performed when the variable is assigned a value.
From the ARITHMETIC EVALUATION section of man bash:
The value of a variable is evaluated as an arithmetic expression when...a variable which has been given the integer attribute using declare -i is assigned a value. A null value evaluates to 0.
Together, these clearly state that the behavior you're seeing is the expected behavior. When the characters t h r e e are evaluated arithmetically, the resulting null value is evaluated as 0, which is then assigned to the variable number.
All assignments in bash are interpreted first as strings. number=10 interprets the 1 0 as a string first, recognizes it as a valid integer, and leaves it as-is. number=three is just as syntactically and semantically valid as number=10, which is why your script continues without any error after assigning the evaluated value of 0 to number.
0will result. What are you trying to do, in a wider perspective?numbershould stay same just like it failed. Setnumberto 0 destroy my original data. It is just a example from a bash script book."5+5"is interpreted as10. You string is interpreted as0as a last resort.