For an array passed with values
$tags = ['tag1','tag2','foo','bar']
the resulting $query
will be
SELECT * FROM (
SELECT
p.id
For an array passed with values
$tags = ['tag1','tag2','foo','bar']
the resulting $query
will be
SELECT * FROM (
SELECT
p.id