mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Branch 2.5 simple fix for PHP 8 Support: Continue -> Continue 2 #6966
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BenKucenski on GitHub (Apr 26, 2022).
Bug Report
I have an old installation of Symphony for a legacy project. It's using Doctrine version 2.5. When trying to run it under PHP 8.0, I get an error: warning: "continue" targeting switch is equivalent to "break." Die you mean to use "continue 2"?
The offending file is
https://github.com/doctrine/orm/blob/2.5/lib/Doctrine/ORM/UnitOfWork.php
Summary
UnitOfWork.php contains 27 instances of the word "continue" and 2 instances of "continue 2" so I assume it is compatible with older versions of PHP. However, there are two instances of "continue" that should be "continue 2" to make PHP 8 happy.
Line 2636
Line 2665
Current behavior
PHP throws an error
How to reproduce
Use Doctrine 2.5 with PHP 8.0
Expected behavior
It is expected to work fine with PHP 8.0
Could you update the older versions of Doctrine to be compatible with 8.0 by making these minor corrections? Currently I have to edit the files which isn't the recommended thing to do with vendor libraries.
Thanks,
Ben
@derrabus commented on GitHub (Apr 26, 2022):
Sorry, but the 2.5 branch is not maintained anymore. I'm afraid you'll have to patch it yourself or upgrade to a more recent release of the ORM.