MDL-40266 - emulate_bound_params() for mysqli:
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
MDL-40266 - Unit tests for emulate_bound_params