Artem Ukrainskiy
6277778f08
Zend: Compile a list assignment from an array literal without the array ( #24180 )
...
[$a, $b] = [$b, $a]; built an array of the values, fetched every element
out of it again and freed it. When the result of the assignment is not
used, the right side is an array literal and the left side a flat list
with a target for every value, assign the values to the targets directly
instead.
The values are still evaluated in order before the first assignment and
a variable among them is copied first. Each target then takes its value,
so a value its target does not keep (a setter that drops it, the same
variable twice, a typed property that coerces it) is released at that
assignment rather than after the last one, and a destructor that throws
there stops the rest of the statement.
Assignments in the expression lists of a for loop, whose results are not
used either, are compiled the same way. Nested lists, keys on either
side, references, spread, a different number of values and targets and
a used result keep the usual compilation.
A swap goes from 922 to 467 instructions per call of a function doing
it, below a swap through a temporary variable (493).
2026-10-19 11:48:28 +02:00
..
2026-10-08 18:47:50 +02:00
2022-08-29 17:12:57 +03:00
2022-11-07 11:07:58 +03:00
2023-01-23 10:52:14 +01:00
2024-03-13 21:40:26 +01:00
2026-10-11 04:30:22 -04:00
2026-10-11 04:30:22 -04:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2025-08-29 16:06:34 +01:00
2023-07-24 15:42:30 +03:00
2023-07-31 14:50:13 +03:00
2023-11-01 09:54:58 +03:00
2026-01-31 19:44:56 +01:00
2026-09-25 10:17:37 +02:00
2026-08-22 13:49:54 +01:00
2024-04-08 20:16:35 +02:00
2026-10-09 23:32:28 +02:00
2026-09-28 00:20:56 +08:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2026-01-31 19:44:56 +01:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-12-27 12:53:02 +01:00
2021-04-08 17:06:40 +02:00
2021-11-25 13:33:26 +03:00
2021-12-06 15:59:30 +03:00
2022-02-28 11:44:22 +03:00
2023-12-25 13:22:03 +03:00
2026-09-28 23:18:46 +02:00
2026-09-29 19:27:01 +02:00
2026-09-29 19:27:02 +02:00
2026-10-12 19:17:54 +02:00
2022-08-01 14:00:19 +03:00
2026-10-08 18:48:24 +02:00
2022-02-22 10:14:54 +01:00
2022-05-05 10:14:56 +02:00
2022-05-05 10:14:56 +02:00
2023-11-02 08:09:29 +03:00
2023-03-10 19:22:44 +01:00
2026-01-31 19:44:56 +01:00
2024-04-08 20:16:35 +02:00
2026-01-15 16:15:29 +01:00
2026-01-31 19:44:56 +01:00
2026-01-31 19:44:56 +01:00
2026-01-31 19:44:56 +01:00
2026-08-22 13:49:54 +01:00
2026-06-16 22:48:17 +02:00
2026-09-12 12:40:23 +02:00
2026-10-02 16:20:51 +02:00
2022-04-10 11:22:36 +02:00
2023-02-08 12:11:41 +00:00
2026-08-22 13:49:54 +01:00
2022-04-25 11:16:10 +03:00
2022-04-25 12:15:55 +03:00
2022-05-11 12:09:11 +03:00
2022-05-11 12:39:26 +03:00
2022-05-16 12:41:25 +03:00
2022-06-06 11:13:53 +03:00
2022-06-14 10:20:45 +03:00
2022-06-14 11:59:35 +03:00
2022-07-18 13:14:15 +03:00
2022-07-18 14:20:06 +03:00
2022-07-25 15:53:06 +03:00
2022-08-22 21:11:39 +03:00
2026-08-22 13:49:54 +01:00
2026-08-22 13:49:54 +01:00
2026-08-22 13:49:54 +01:00
2023-07-17 15:51:24 +01:00
2022-09-19 15:45:34 +03:00
2022-09-26 12:19:12 +03:00
2023-10-31 07:51:36 +03:00
2023-11-28 22:49:39 +03:00
2023-12-01 17:08:16 +03:00
2024-04-08 20:22:02 +02:00
2022-06-20 10:59:37 +03:00
2022-04-25 13:31:01 +03:00
2026-01-31 19:44:56 +01:00
2021-12-10 01:39:28 +03:00
2026-10-19 11:48:28 +02:00
2022-10-17 15:08:21 +03:00
2022-12-26 13:20:55 +03:00
2023-03-27 17:57:54 +03:00
2024-04-08 20:16:35 +02:00
2024-07-27 16:37:01 +02:00
2026-09-19 23:47:23 +02:00
2024-07-27 16:37:01 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2024-04-08 20:16:35 +02:00
2024-04-08 20:16:35 +02:00
2021-04-03 15:23:25 +02:00
2024-04-08 20:16:35 +02:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2026-01-31 19:44:56 +01:00
2021-04-03 15:23:25 +02:00
2024-04-08 20:16:35 +02:00
2021-04-03 15:23:25 +02:00
2024-04-08 20:16:35 +02:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2021-04-03 15:23:25 +02:00
2024-04-08 20:16:35 +02:00
2026-01-31 19:44:56 +01:00
2021-04-03 15:23:25 +02:00
2021-12-13 13:08:05 +03:00
2021-12-24 13:10:22 +03:00
2022-01-10 19:39:19 +03:00
2022-01-28 12:17:46 +03:00
2025-08-23 14:36:39 +01:00
2022-04-18 10:33:52 +03:00
2022-05-16 13:45:31 +03:00
2022-06-20 11:30:07 +03:00
2026-10-08 18:43:09 +02:00
2026-10-04 10:01:27 +02:00
2020-11-27 17:44:30 +01:00
2020-11-27 20:24:00 +01:00
2020-11-27 20:24:00 +01:00
2020-11-27 17:00:12 +01:00
2020-11-30 11:18:21 +01:00
2026-10-05 19:59:34 +02:00
2026-10-04 16:42:55 +02:00
2026-10-08 18:43:09 +02:00
2026-08-22 13:49:54 +01:00
2024-04-10 01:17:10 +02:00
2024-04-10 01:17:10 +02:00
2024-04-10 01:17:10 +02:00
2024-04-10 01:17:10 +02:00
2026-01-31 19:44:56 +01:00
2021-10-06 17:21:02 +03:00