Yes, but the OP is also invoking new variables, which means more typing which means more possibility of errors.
$order_item_quantity = intval($row['oi.quantity']);
$stock_quantity = intval($row['st.quantity']);
$stock_id = intval($row['st.stock_id']);
Which in turn can lead to code comprehension issues further down the script, "$stock_id? Hang on, where did that come from?" rather than the rather more explicit $row['stock_id']; (or maybe that could be the more expressive $lastOrder['stock_id']).
Now if you are planning on using $stock_id in multiple places, then that would be a good argument for invoking that new variable. If the argument is that you don't like typing or reading:
all over the place then use the object notation:
All I am saying is that to adopt a policy of typecasting to an integer what should only be an integer because of the fear a column which ought to contain integers might be accidentally defined as being a varchar will invariably lead to errors somewhere else because of the increased illegibility of the code - if indeed it this is the OPs case.
I know because that is how I used to think, pretty much like I used to use $row for every 'row'. **
I can see the OPs point, but I thought I'd take the trouble to explode.
**Anyway, this is all Anthony's fault he sent me a spare copy of Bob Martins Clean Code.