---
title: "Breaking: #96044 - Harden method signature of logicalAnd() and logicalOr()"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:breaking-96044"
source: "Changelog/12.0/Breaking-96044-HardenMethodSignatureOfLogicalAndAndLogicalOr.rst"
typo3-version: "12.0"
typo3-major: 12
type: "breaking"
issue: 96044
forge: "https://forge.typo3.org/issues/96044"
tags: ["PHP-API", "FullyScanned", "ext:extbase"]
rendered: "2026-10-01T16:39:42+00:00"
---

# Breaking: #96044 - Harden method signature of logicalAnd() and logicalOr() {#breaking-96044}

See [forge#96044](https://forge.typo3.org/issues/96044)

## Description {#description}

The method signature of `\TYPO3\CMS\Extbase\Persistence\QueryInterface::logicalAnd()`
and `\TYPO3\CMS\Extbase\Persistence\QueryInterface::logicalOr()` has changed.
As a consequence the method signature of `\TYPO3\CMS\Extbase\Persistence\Generic\Query::logicalAnd()`
and `\TYPO3\CMS\Extbase\Persistence\Generic\Query::logicalOr()` has changed as well.

Both methods do no longer accept an array as first parameter.

Both methods do indeed accept an infinite number of further constraints.

The `logicalAnd()` method does now reliably return an instance of
`\TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface` instance
while the `logicalOr()` method returns a `\TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface`
instance.

## Impact {#impact}

This change impacts all usages of said methods with just one array parameter containing all constraints.

## Affected Installations {#affected-installations}

All installations that passed all constraints as array.

## Migration {#migration}

The migration is the same for `logicalAnd()` and `logicalOr()`
since their method signature is the same. The upcoming example will show a
migration for a `logicalAnd()` call.

**Example**:

```php
$query = $this->createQuery();
$query->matching($query->logicalAnd([
    $query->equals('propertyName1', 'value1'),
    $query->equals('propertyName2', 'value2'),
    $query->equals('propertyName3', 'value3'),
]));
```

In this case an array is used as one and only method argument. The migration is
easy and quickly done. Simply don't use an array:

```php
$query = $this->createQuery();
$query->matching($query->logicalAnd(
    $query->equals('propertyName1', 'value1'),
    $query->equals('propertyName2', 'value2'),
    $query->equals('propertyName3', 'value3'),
));
```

Alternatively you can use the spread operator `...` to expand your array to arguments:

```php
$query = $this->createQuery();
$arrayOfConditions = [];
$arrayOfConditions[] = $query->equals('propertyName1', 'value1');
$arrayOfConditions[] = $query->equals('propertyName2', 'value2');
$arrayOfConditions[] = $query->equals('propertyName3', 'value3');
$query->matching($query->logicalAnd(...$arrayOfConditions));
```

> [!TIP]
> Wrapping the array to spread into `logicalAnd()` using `array_values()` avoids
> spreading associative array element keys as as named arguments, for example:
> `$query->matching($query->logicalAnd(...array_values($arrayOfConditions)));`
