$OpenBSD: patch-ext_spl_php_spl_c,v 1.5 2017/09/01 08:25:02 sthen Exp $
Index: ext/spl/php_spl.c
--- ext/spl/php_spl.c.orig
+++ ext/spl/php_spl.c
@@ -780,19 +780,19 @@ PHP_FUNCTION(spl_object_hash)
 
 PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
 {
-	intptr_t hash_handle, hash_handlers;
+	zend_intptr_t hash_handle, hash_handlers;
 
 	if (!SPL_G(hash_mask_init)) {
 		if (!BG(mt_rand_is_seeded)) {
 			php_mt_srand((uint32_t)GENERATE_SEED());
 		}
 
-		SPL_G(hash_mask_handle)   = (intptr_t)(php_mt_rand() >> 1);
-		SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand() >> 1);
+		SPL_G(hash_mask_handle)   = (zend_intptr_t)(php_mt_rand() >> 1);
+		SPL_G(hash_mask_handlers) = (zend_intptr_t)(php_mt_rand() >> 1);
 		SPL_G(hash_mask_init) = 1;
 	}
 
-	hash_handle   = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj);
+	hash_handle   = SPL_G(hash_mask_handle)^(zend_intptr_t)Z_OBJ_HANDLE_P(obj);
 	hash_handlers = SPL_G(hash_mask_handlers);
 
 	return strpprintf(32, "%016lx%016lx", hash_handle, hash_handlers);
