#60326 closed defect (bug) (fixed)
Unset variable set by reference after a foreach loop
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.5 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Applies the changes from https://github.com/WordPress/gutenberg/pull/55261 which needed to be synced to Core.
In PHP it is a good practice to unset $value if it was created by reference in a foreach loop, as the reference is still valid outside the loop, and this avoids accidental bugs.
Change History (4)
This ticket was mentioned in PR #5934 on WordPress/wordpress-develop by @get_dave.
22 months ago
#1
- Keywords has-patch added
#3
@
22 months ago
- Owner set to youknowriad
- Resolution set to fixed
- Status changed from new to closed
In 57340:
@youknowriad commented on PR #5934:
22 months ago
#4
Note: See
TracTickets for help on using
tickets.
Applies the changes from https://github.com/WordPress/gutenberg/pull/55261 which need to be synced to Core.
In PHP it is a good practice to unset $value if it was created by reference in a foreach loop, as the reference is still valid outside the loop, and this avoids accidental bugs.
Trac ticket: https://core.trac.wordpress.org/ticket/60326