rfc:nullsafe_calls

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
Next revisionBoth sides next revision
rfc:nullsafe_calls [2014/12/09 19:47] jwatzmanrfc:nullsafe_calls [2014/12/09 23:08] jwatzman
Line 1: Line 1:
 ====== PHP RFC: Nullsafe Calls ====== ====== PHP RFC: Nullsafe Calls ======
-  * Version: 0.+  * Version: 1.0 
-  * Date: 2014-12-03+  * Date: 2014-12-09
   * Author: Josh Watzman (jwatzman@fb.com), Drew Paroski   * Author: Josh Watzman (jwatzman@fb.com), Drew Paroski
-  * Status: Draft+  * Status: Under Discussion
   * First Published at: https://wiki.php.net/rfc/nullsafe_calls   * First Published at: https://wiki.php.net/rfc/nullsafe_calls
  
Line 65: Line 65:
  
 This is just a technicality... all of my attempts to actually hit that limit put my machine into swapdeath long before I got close :-P This is just a technicality... all of my attempts to actually hit that limit put my machine into swapdeath long before I got close :-P
 +
 +See also "RFC Impact To Existing Extensions" below.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 71: Line 73:
 ===== RFC Impact ===== ===== RFC Impact =====
 ==== To Existing Extensions ==== ==== To Existing Extensions ====
-Do extensions have access to the opline's ''extended_value''? If soat least with the current implementation, they will have to be updated to deal with one of the bits being used for a different purpose.+Extensions have access to an opline's ''extended_value'', and the current implementation re-uses a single bit at the top of it for a new purpose. This is a backwards compatibility break for extensions which read the ''extended_value'' out of the "begin fcall" opcode -- though arguably extensions like RunKit which do this probably shouldn't be anyways ;) 
 + 
 +If this impact is deemed too much, there are certainly other implementation options, which I think are less attractive. We could add a new ''OP_DATA'' opcode after the begin fcall, but that seems like dramatic overkill for storing a single bit.
  
 ==== New Constants ==== ==== New Constants ====
Line 89: Line 93:
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-  * php-src: I have a scratch branch at https://github.com/jwatzman/php-src/compare/nullsafe-prototype?expand=1 with a working implementation. As the RFC progresses, I plan to squash that down into a nicer PR for review+  * php-src: I have a branch at https://github.com/jwatzman/php-src/compare/nullsafe-prototype?expand=1 with a working implementation. Includes tests copied from HHVM's implementation
-  * PHP spec: nothing yet, but this shouldn't take too long.+  * PHP spec: not yet, but will do if the RFC is accepted.
   * PHP docs: import Hack's documentation when they add it: https://github.com/hhvm/hack-hhvm-docs/issues/360 (that task will get completed well before this RFC is voted on, accepted, merged, etc)   * PHP docs: import Hack's documentation when they add it: https://github.com/hhvm/hack-hhvm-docs/issues/360 (that task will get completed well before this RFC is voted on, accepted, merged, etc)
  
rfc/nullsafe_calls.txt · Last modified: 2020/08/03 10:09 by ilutov