1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
Ilija Tovilo 6173a9a109 VAR|TMP overhaul (GH-20628)
The aim of this PR is twofold:

- Reduce the number of highly similar TMP|VAR handlers
- Avoid ZVAL_DEREF in most of these cases

This is achieved by guaranteeing that all zend_compile_expr() calls, as well as
all other compile calls with BP_VAR_{R,IS}, will result in a TMP variable. This
implies that the result will not contain an IS_INDIRECT or IS_REFERENCE value,
which was mostly already the case, with two exceptions:

- Calls to return-by-reference functions. Because return-by-reference functions
  are quite rare, this is solved by delegating the DEREF to the RETURN_BY_REF
  handler, which will examine the stack to check whether the caller expects a
  VAR or TMP to understand whether the DEREF is needed. Internal functions will
  also need to adjust by calling the zend_return_unwrap_ref() function.

- By-reference assignments, including both $a = &$b, as well as $a = [&$b]. When
  the result of these expressions is used in a BP_VAR_R context, the reference
  is unwrapped via a ZEND_QM_ASSIGN opcode beforehand. This is exceptionally
  rare.

Closes GH-20628
2026-01-31 19:44:56 +01:00
..
2022-08-29 17:12:57 +03:00
2022-11-07 11:07:58 +03:00
2022-05-23 13:33:20 +03:00
2026-01-31 19:44:56 +01:00
2021-04-08 17:06:40 +02:00
2022-02-28 11:44:22 +03:00
2023-12-25 13:22:03 +03: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-01-31 19:44:56 +01:00
2022-04-10 11:22:36 +02: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 14:20:06 +03:00
2022-07-25 15:53:06 +03:00
2022-08-22 21:11:39 +03:00
2022-09-26 12:19:12 +03:00
2023-12-01 17:08:16 +03:00
2022-06-20 10:59:37 +03:00
2026-01-31 19:44:56 +01:00
2021-12-10 01:39:28 +03:00
2022-10-17 15:08:21 +03:00
2023-03-27 17:57:54 +03:00
2026-01-31 19:44:56 +01:00
2026-01-31 19:44:56 +01:00
2021-12-24 13:10:22 +03:00
2022-01-10 19:39:19 +03:00
2022-05-16 13:45:31 +03:00