Skip to content

Commit ee5fbc6

Browse files
authoredNov 3, 2021
Merge pull request #222 from remicollet/issue-php81
Fix for PHP 8.1
2 parents 43464c4 + 9af012e commit ee5fbc6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
 

‎tests/053-z85.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ for ($i = 4; $i <= 256; $i += 4) {
4141

4242
// Incorrect length
4343
test_z85_encode('1234567', null);
44-
test_z85_encode(null, null);
44+
test_z85_encode('', null);
4545

4646
test_z85_decode('1234567', null);
47-
test_z85_decode(null, null);
47+
test_z85_decode('', null);
4848

4949
echo "OK";
5050

5151
--EXPECT--
52-
OK
52+
OK

‎zmq_pollset.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,15 @@ static
169169
zend_string *s_create_key(zval *entry)
170170
{
171171
if (Z_TYPE_P(entry) == IS_RESOURCE) {
172-
return strpprintf(0, "r:%d", Z_RES_P(entry)->handle);
172+
/* zend_long since 8.1.0 */
173+
return strpprintf(0, "r:%ld", (long)Z_RES_P(entry)->handle);
173174
}
174175
else {
176+
#if PHP_VERSION_ID >= 80100
177+
zend_string *hash = php_spl_object_hash(Z_OBJ_P(entry));
178+
#else
175179
zend_string *hash = php_spl_object_hash(entry);
180+
#endif
176181
zend_string *key = strpprintf(0, "o:%s", hash->val);
177182
zend_string_release(hash);
178183
return key;

0 commit comments

Comments
 (0)
Please sign in to comment.