Commit 787ffe1
Use separate attribute for callCallbackImmediately to avoid breaking by-ref closure loop
The previous commit reused ImmediatelyInvokedClosureVisitor::ATTRIBUTE_NAME for
callbacks that are invoked immediately (e.g. array_map). This caused a regression
because NodeScopeResolver::processClosureNode uses that same attribute to break
the do-while loop after one iteration (correct for IIFEs called once, but wrong
for array_map callbacks called multiple times with by-ref variables like &$isVariadic).
Introduces a new CALL_CALLBACK_IMMEDIATELY_ATTRIBUTE_NAME constant to distinguish
"callback invoked immediately by a function" from "IIFE called exactly once".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 2e7e5ef commit 787ffe1
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
2155 | 2156 | | |
2156 | 2157 | | |
2157 | 2158 | | |
| 2159 | + | |
2158 | 2160 | | |
2159 | 2161 | | |
2160 | 2162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3408 | 3408 | | |
3409 | 3409 | | |
3410 | 3410 | | |
3411 | | - | |
| 3411 | + | |
3412 | 3412 | | |
3413 | 3413 | | |
3414 | 3414 | | |
| |||
3471 | 3471 | | |
3472 | 3472 | | |
3473 | 3473 | | |
3474 | | - | |
| 3474 | + | |
3475 | 3475 | | |
3476 | 3476 | | |
3477 | 3477 | | |
| |||
0 commit comments