Can I select a preference between IP versions?

 

I have an app in PHP which runs from the shell, is it possible to indicate a preference as to which IP stack is used?

 

The destination has today enabled IPv6, however, the route via IPv4 is still a faster route so would like to use IPv4 in preference but do not wish to simply drop the IPv6 stack as the routing / speed may well improve over time.