rfc:hash-context.as-resource

Differences

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

Link to this comparison view

Next revision
Previous revision
rfc:hash-context.as-resource [2016/12/27 03:32] – created pollitarfc:hash-context.as-resource [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * Date: 2016-12-26   * Date: 2016-12-26
   * Author: Sara Golemon <pollita@php.net>, with initial implementation from Rouven Weßling <me@rouvenwessling.de>   * Author: Sara Golemon <pollita@php.net>, with initial implementation from Rouven Weßling <me@rouvenwessling.de>
-  * Status: Under Discussion+  * Status: Accepted
   * First Published at: http://wiki.php.net/rfc/hash-context.as-resource   * First Published at: http://wiki.php.net/rfc/hash-context.as-resource
  
Line 10: Line 10:
  
 ===== Proposal ===== ===== Proposal =====
-Convert the opaque resource to an opaque object.  This is the lightest touch change to ensure that existing code should continue to function unless it has explciit is_resource() checks.  These checks can be easily replaced with is_resource|is_object checks instead.+Convert the opaque resource to an opaque object.  This is the lightest touch change to ensure that existing code should continue to function unless it has explicit is_resource() checks.  These checks can be easily replaced with is_resource|is_object checks instead.
  
 ===== Future Scope ===== ===== Future Scope =====
Line 29: Line 29:
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-Include the patch at https://github.com/php/php-src/compare/master...sgolemon:pr-660 50%+1 required.+Include one or both patches at https://github.com/php/php-src/pull/2309 50%+1 required. 
 + 
 +This primary vote is to determine, overall, if the "hash context" resource used by hash_init/hash_update/hash_final should be changed to an object. 
 + 
 +<doodle title="Change HashContext to an object" auth="sgolemon" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle> 
 + 
 +This second vote, contingent on passing the first vote, determines which behavior the new HashContext will adopt (per the "Open Issue" above). 
 + 
 +  * "Frozen": Only apply [[https://github.com/php/php-src/pull/2309/commits/e29923471b54b5b0712978274404c37f34d34ea6 | the original patch]] which will invalidate the HashContext object upon calling hash_final().  This is consistent with the current behavior of the resource, but inconsistent with most class/object definitions in PHP. 
 +  * "Reentrant": Apply both diffs in [[https://github.com/php/php-src/pull/2309|PR#2309]] which will allow contexts to continue functioning after calling hash_final() by effectively performing: $saved = hash_copy($ctx); $ret = hash_final($ctx); $ctx = $saved; 
 + 
 +<doodle title="Merge one or both diffs" auth="sgolemon" voteType="single" closed="true"> 
 +   * Frozen 
 +   * Reentrant 
 +</doodle> 
 + 
 +Voting opened2017-01-17 22:50:00 UTC 
 +\\ Voting closes: 2017-01-31 23:59:59 UTC
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-  * Implementation for PHP 7.2 https://github.com/php/php-src/compare/master...sgolemon:pr-660+  * Implementation for PHP 7.2 https://github.com/php/php-src/pull/2309
   * Original PR by Rouven Weßling: https://github.com/php/php-src/pull/660   * Original PR by Rouven Weßling: https://github.com/php/php-src/pull/660
  
rfc/hash-context.as-resource.1482809574.txt.gz · Last modified: 2017/09/22 13:28 (external edit)