xref: /PHP-8.3/ext/hash/tests/gh12186_1.phpt (revision 10f5a06d)
1--TEST--
2Hash: bug #12186 - segfault in hash_copy() on a finalized context
3--FILE--
4<?php
5
6$c = hash_init('sha1');
7hash_final($c);
8
9try {
10    hash_copy($c);
11} catch (Throwable $ex) {
12    echo $ex->getMessage() . "\n";
13}
14
15?>
16--EXPECTF--
17hash_copy(): Argument #1 ($context) must be a valid, non-finalized HashContext
18