rfc:weakrefs

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:weakrefs [2018/05/17 07:28]
krakjoe
rfc:weakrefs [2019/03/13 09:31] (current)
krakjoe
Line 3: Line 3:
   * Date: 2018-05-17   * Date: 2018-05-17
   * Author: krakjoe   * Author: krakjoe
-  * Status: Discussion+  * Status: Implemented
   * First Published at: http://wiki.php.net/rfc/weakrefs   * First Published at: http://wiki.php.net/rfc/weakrefs
  
Line 17: Line 17:
 ===== Proposal ===== ===== Proposal =====
 We directly support weak referencing in the simplest possible way. We directly support weak referencing in the simplest possible way.
 +
 +===== API =====
 +The proposed API:
 +
 +<code php>
 +final class WeakReference {
 +    public static function create(object $object) : WeakReference;
 +    
 +    public function get() : ?object;
 +}
 +</code>
 +
 +The proposed API differs from the documented [[http://docs.php.net/class.weakref|WeakRef]] class. The currently documented API includes the following methods omitted from the proposed API:
 +
 +  * valid
 +  * acquire
 +  * release
 +
 +Acquire and release are sugar for get and unset, and valid is simply superfluous since the get method will not throw an exception and null is a falsy value.
 +
 +===== Implementation Details =====
 +
 +The proposed API:
 +
 +  * is closed
 +  * does not support serialization
 +  * does not support properties
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 22: Line 49:
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-PHP 7.3+PHP 7.4
  
 ===== RFC Impact ===== ===== RFC Impact =====
Line 48: Line 75:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
 Simple Yes/No, requires super majority. Simple Yes/No, requires super majority.
 +
 +<doodle title="Implement weakrefs ?" auth="krakjoe" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
 +
 +Voting started 2019-02-22, ends 2019-03-08.
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-https://github.com/php/php-src/pull/3237+https://github.com/php/php-src/pull/3787
  
 ===== References ===== ===== References =====
-https://externals.io/message/102111+Announce: https://externals.io/message/102111 
 + 
 +Re-announce: https://externals.io/message/104014
rfc/weakrefs.1526542109.txt.gz · Last modified: 2018/05/17 07:28 by krakjoe