
I have the same problem.
My configuration: Postgre13 and php 7.4.11.
I confirm the same behavior on our app (Laravel 6) deploy with bitbucket pipepines.
PHP 7.4.5
PostgreSQL10
I my case it happens during migrations apply.
assert(preg_match(
'/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/',
$tableForeignKey['condef'],
$values
) !== 0);
https://www.php.net/manual/en/function.preg-match.php
preg_match() returns 1 if the pattern matches given subject, 0 if it does not, or FALSE if an error occurred.
I can confirm the same error in the PostgreSqlSchemaManager.php.
In my case it was with php 7.4.11 and Postgres 10.6
Same error after 2.11.2 update (from 2.11.1).
PHP 7.4.11 & PostgreSQL 12.4
The code inside assert() does not run at all, leaving $values as undefined variable
Can also confirm the problem, 2.11.2 from 2.11.1, PostgresSQL, PHP 7.4.11.
Confirmed, downgrading to 2.11.1 fixes it fine.
In my case I got it in Symfony 5.1 when running:
./bin/console doctrine:schema:drop --force --quiet
The issue is reproducible via the existing test suite with disabled assertions (zend.assertions=-1):
$ phpunit -c pdo-pgsql.phpunit.xml tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
PHPUnit 9.4.0 by Sebastian Bergmann and contributors.
......EE.E...EEE...............E.......EEE....EE.....E.E.S...........S........... 81 / 85 ( 95%)
..S. 85 / 85 (100%)
Time: 00:07.376, Memory: 18.00 MB
There were 14 errors:
1) Doctrine\Tests\DBAL\Functional\Schema\PostgreSqlSchemaManagerTest::testTableWithSchema
Exception: [PHPUnit\Framework\Error\Notice] Undefined variable: values
...
Holy shit, i've spent so many hours trying to find this thread via google, but found only after i've looked into blame for file)
Most helpful comment
The code inside assert() does not run at all, leaving $values as undefined variable