rfc:explicit_send_by_ref

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:explicit_send_by_ref [2020/02/20 13:58] nikicrfc:explicit_send_by_ref [2022/01/25 18:21] (current) – Move to inactive ilutov
Line 1: Line 1:
-====== PHP RFC: Explicit call-site pass-by-reference ======+====== PHP RFC: Allow explicit call-site pass-by-reference annotation ======
   * Date: 2017-12-02   * Date: 2017-12-02
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
   * Proposed for: PHP 8.0   * Proposed for: PHP 8.0
   * Implementation: https://github.com/php/php-src/pull/2958   * Implementation: https://github.com/php/php-src/pull/2958
-  * Status: Under Discussion+  * Status: Inactive
  
 ===== Introduction ===== ===== Introduction =====
Line 166: Line 166:
  
 If the argument is a prefer-ref argument of an internal function, then adding the ''&'' annotation will pass it by reference, while not adding it will pass it by value. Outside this mode, the passing behavior would instead be determined by the VM kind of the argument operand. If the argument is a prefer-ref argument of an internal function, then adding the ''&'' annotation will pass it by reference, while not adding it will pass it by value. Outside this mode, the passing behavior would instead be determined by the VM kind of the argument operand.
 +
 +Just like ''strict_types'', the ''require_explicit_send_by_ref'' option only affects call-sites inside the file. Whether the function was declared in a file with ''require_explicit_send_by_ref'' enabled or not does not matter, only the used mode at the call-site matters.
  
 ==== Forwarding references in __call, call_user_func and similar ==== ==== Forwarding references in __call, call_user_func and similar ====
rfc/explicit_send_by_ref.1582207113.txt.gz · Last modified: 2020/02/20 13:58 by nikic