N1QL query throwing exception: LCB_EINVAL: Invalid input/arguments

Sorry, the docs hasn’t been updated after the code change. You should do it like this

$query = CouchbaseN1qlQuery::fromString("SELECT * FROM `default` WHERE \$p IN interests");
$query->namedParams(array("p" => "African Swallows"));
echo "Parameterized query:\n";
var_dump($query);
$rows = $bucket->query($query);
echo "Results:\n";
var_dump($rows);

like described here http://developer.couchbase.com/documentation/server/4.5/sdk/php/n1ql-queries-with-sdk.html