当php从7.2.1更改为7.1.12时,查询返回不同的表

I'm changing between PHP 7.1.12 and 7.2.1 on my localhost (MAMP) so I can update my PHP accordingly to ensure nothing has broken. I have come across a strange problem where when I change between the two versions, I get different results from the SQL query.


Here's an example (same SQL query for all instances):
SELECT * FROM uploads WHERE upload_artist IN (SELECT following FROM followers WHERE follower = x) ORDER BY upload_id

PHP 7.1.12 returns:

object(stdClass)#5 (...) {
    ["user_id"]=> string(1) "6", etc...
}

Whereas PHP 7.2.1 returns (notice how it says "upload_id" instead of "user_id") [THIS IS THE CORRECT OUTPUT]:

object(stdClass)#5 (...) {
    ["upload_id"]=> string(1) "3", etc...
}


Both PHP versions are using the same flavour of MySQL and are on the same machine, using the same host. What is causing this to happen and how can I fix it?

Cheers.