Both sides previous revisionPrevious revisionNext revision | Previous revision |
rfc:hash-context.as-resource [2017/01/17 22:50] – Add open/close voting times/dates pollita | rfc:hash-context.as-resource [2017/09/22 13:28] (current) – external edit 127.0.0.1 |
---|
* 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: Voting | * 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 |
| |
| |
===== 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 ===== |
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. | 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="false"> | <doodle title="Change HashContext to an object" auth="sgolemon" voteType="single" closed="true"> |
* Yes | * Yes |
* No | * No |
| |
* "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. | * "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(). | * "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="false"> | <doodle title="Merge one or both diffs" auth="sgolemon" voteType="single" closed="true"> |
* Frozen | * Frozen |
* Reentrant | * Reentrant |
| |
Voting opened: 2017-01-17 22:50:00 UTC | Voting opened: 2017-01-17 22:50:00 UTC |
| \\ Voting closes: 2017-01-31 23:59:59 UTC |
Voting closes: 2017-01-17 23:59:59 UTC | |
| |
===== Patches and Tests ===== | ===== Patches and Tests ===== |