#1051214 poll->add() returns same id for every socket added

Package:
php-zmq
Source:
php-zmq
Description:
ZeroMQ messaging bindings for PHP
Submitter:
Fernando M. Maresca (Monitoring Station S.A.)
Date:
2023-09-04 15:09:04 UTC
Severity:
normal
#1051214#5
Date:
2023-09-04 14:39:49 UTC
From:
To:
poll->add() allways returns same id for the added socket, and only the
first added socket is actually polled.

This affects the current php version, does not occurs in 7.4

This problem seems to originate here:

zend_string *s_create_key(zval *entry)
{
	if (Z_TYPE_P(entry) == IS_RESOURCE) {
		/* zend_long since 8.1.0 */
		return strpprintf(0, "r:%ld", (long)Z_RES_P(entry)->handle);
	}
	else {
#if PHP_VERSION_ID >= 80100
		zend_string *hash = php_spl_object_hash(Z_OBJ_P(entry));
#else
		zend_string *hash = php_spl_object_hash(entry);
#endif
		zend_string *key = strpprintf(0, "o:%s", hash->val);
		zend_string_release(hash);
		return key;
	}
}


Thank you.