Having trouble with php8 bindings

Olly Betts olly at survex.com
Thu Mar 30 05:27:37 BST 2023


On Thu, Mar 30, 2023 at 05:16:16AM +0100, John Handelaar wrote:
> This then (because of course) led to some more things needing tidying
> up and I've run into something I can't work out while trying to update
> previously-worked-in-php7 code in the actual file I'm trying to update
> 
>     $this->queryparser->set_default_op(Query_OP_AND);
> 
> ...leads to "Undefined constant "App\Helpers\Query_OP_AND" because...
> another namespace issue?
> 
> ("OP_AND" and "XapianQueryParser::OP_AND" are also not accepted.)

It's `XapianQuery::OP_AND`, which was also the correct name in the PHP7
bindings.

Looks like `Query_OP_AND` used to happen to work due to how SWIG
implemented PHP7 wrappers, but it isn't what we intended people to be
using.

Cheers,
    Olly



More information about the Xapian-discuss mailing list