#60326 closed defect (bug) (fixed)
Unset variable set by reference after a foreach loop
| Reported by: | get_dave | Owned by: | youknowriad |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.5 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
3 years ago
#1
- Keywords has-patch added
@youknowriad commented on PR #5934:
3 years ago
#4
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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