@@ -1511,8 +1511,7 @@ void phongo_manager_init(php_phongo_manager_t *manager, const char *uri_string,
1511
1511
bson_iter_t iter ;
1512
1512
1513
1513
#if PHP_VERSION_ID >= 70000
1514
- zval * client_ptr ;
1515
- zval new_client_ptr ;
1514
+ mongoc_client_t * client_ptr ;
1516
1515
#else
1517
1516
mongoc_client_t * * client_ptr ;
1518
1517
#endif
@@ -1523,9 +1522,9 @@ void phongo_manager_init(php_phongo_manager_t *manager, const char *uri_string,
1523
1522
}
1524
1523
1525
1524
#if PHP_VERSION_ID >= 70000
1526
- if ((client_ptr = zend_hash_str_find (& MONGODB_G (clients ), hash , hash_len )) && Z_TYPE_P ( client_ptr ) == IS_PTR ) {
1525
+ if ((client_ptr = zend_hash_str_find_ptr (& MONGODB_G (clients ), hash , hash_len )) != NULL ) {
1527
1526
MONGOC_DEBUG ("Found client for hash: %s\n" , hash );
1528
- manager -> client = ( mongoc_client_t * ) Z_PTR_P ( client_ptr ) ;
1527
+ manager -> client = client_ptr ;
1529
1528
goto cleanup ;
1530
1529
}
1531
1530
#else
@@ -1582,8 +1581,7 @@ void phongo_manager_init(php_phongo_manager_t *manager, const char *uri_string,
1582
1581
1583
1582
MONGOC_DEBUG ("Created client hash: %s\n" , hash );
1584
1583
#if PHP_VERSION_ID >= 70000
1585
- ZVAL_PTR (& new_client_ptr , manager -> client );
1586
- zend_hash_str_update (& MONGODB_G (clients ), hash , hash_len , & new_client_ptr );
1584
+ zend_hash_str_update_ptr (& MONGODB_G (clients ), hash , hash_len , manager -> client );
1587
1585
#else
1588
1586
zend_hash_update (& MONGODB_G (clients ), hash , hash_len + 1 , & manager -> client , sizeof (mongoc_client_t * ), NULL );
1589
1587
#endif
0 commit comments