None of the various iPhone models in my family (5) can do that.
The iPad, however, does.
Meanwhile, this is a neat trick from https://www.iphonelife.com/content/how-to-type-numbers-stay-standard-iphone-keyboard:
How to access numbers and symbols without leaving the ABC keyboard on your iPhone.
To begin, open an app where you use your iPhone's keyboard, such as Messages or Notes.
- Tap the text field to reveal the standard iPhone keyboard, and begin typing.
- Touch and hold the 123 button. It works best to do this with your non-dominant hand, as you'll need to keep holding it while you type the numbers and/or symbols.
- Type the numbers or symbols you need using your other hand, then release the 123 button.