Branch 2.5 simple fix for PHP 8 Support: Continue -> Continue 2 #6966

Closed
opened 2026-01-22 15:42:19 +01:00 by admin · 1 comment
Owner

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

Q A
BC Break yes
Version 2.5

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

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 | Q | A |------------ | ------ | BC Break | yes | Version | 2.5 #### 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
admin closed this issue 2026-01-22 15:42:19 +01:00
Author
Owner

@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.

@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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6966