Personally, I prefer the first of four. It’s clear what you are doing, so your code will be easier to maintain. Using arrays is useful when the array already exists and all values will be used in the query. However, when writing code you will encounter errors. And debugging queries that use placeholders ? may be a pain.
When it comes to performance, there is no big difference between any of the four approaches, but there are some differences:
In 2 of 4 examples, you create an array. Creating arrays is cheap, but not free.
When using bindParam you can easily specify the data type (just look at the predefined PDO constants). In most cases this will not matter much, but in cases where a full table scan is performed, it is usually better that MySQL does not do type conversions.
So, performance: don't create new arrays if you don't need it, and set the correct data type if possible.
By code quality: named parameters usually make your life easier, so I would advise you to use them as much as you can
source share