1.2.526. Hash Will Use Objects¶
The ext/hash extension used resources, and is being upgraded to use resources.
<?php
// Post 7.2 code
$hash = hash_init('sha256');
if (!is_object($hash)) {
trigger_error('error');
}
hash_update($hash, $message);
// Pre-7.2 code
$hash = hash_init('md5');
if (!is_resource($hash)) {
trigger_error('error');
}
hash_update($hash, $message);
?>
See also Move ext/hash from resources to objects.
1.2.526.1. Connex PHP features¶
1.2.526.1.1. Specs¶
Short name |
Php/HashUsesObjects |
Rulesets |
|
Exakat since |
1.0.4 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |