Skip to content
Browse files

- Change unset() functions to null(). unset() is legacy

  • Loading branch information...
1 parent 00b8470 commit 0611acb910003f86287f0a0e0163f42bce9b1e62 @andigutmans andigutmans committed
Showing with 23 additions and 17 deletions.
  1. +4 −4 Zend/zend_API.c
  2. +12 −6 Zend/zend_API.h
  3. +2 −2 ext/ingres_ii/ii.c
  4. +2 −2 ext/mysql/php_mysql.c
  5. +2 −2 ext/pgsql/pgsql.c
  6. +1 −1 ext/standard/scanf.c
8 Zend/zend_API.c
@@ -237,7 +237,7 @@ ZEND_API inline int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
-ZEND_API inline int add_assoc_unset_ex(zval *arg, char *key, uint key_len)
+ZEND_API inline int add_assoc_null_ex(zval *arg, char *key, uint key_len)
zval *tmp;
@@ -317,7 +317,7 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
-ZEND_API inline int add_index_unset(zval *arg, uint index)
+ZEND_API inline int add_index_null(zval *arg, uint index)
zval *tmp;
@@ -399,7 +399,7 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
-ZEND_API inline int add_next_index_unset(zval *arg)
+ZEND_API inline int add_next_index_null(zval *arg)
zval *tmp;
@@ -557,7 +557,7 @@ ZEND_API inline int add_property_bool_ex(zval *arg, char *key, uint key_len, int
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
-ZEND_API inline int add_property_unset_ex(zval *arg, char *key, uint key_len)
+ZEND_API inline int add_property_null_ex(zval *arg, char *key, uint key_len)
zval *tmp;
18 Zend/zend_API.h
@@ -147,7 +147,7 @@ ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n);
-ZEND_API int add_assoc_unset_ex(zval *arg, char *key, uint key_len);
+ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len);
ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b);
ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r);
ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d);
@@ -156,7 +156,7 @@ ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str,
ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
-#define add_assoc_unset(__arg, __key) add_assoc_unset_ex(__arg, __key, strlen(__key) + 1)
+#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
#define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
#define add_assoc_double(__arg, __key, __d) add_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
@@ -164,8 +164,14 @@ ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
#define add_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
+/* unset() functions are only suported for legacy modules and null() functions should be used */
+#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
+#define add_index_unset(__arg, __key) add_index_null(__arg, __key)
+#define add_next_index_unset(__arg) add_next_index_null(__arg)
+#define add_property_unset(__arg, __key) add_property_null(__arg, __key)
ZEND_API int add_index_long(zval *arg, uint idx, long n);
-ZEND_API int add_index_unset(zval *arg, uint idx);
+ZEND_API int add_index_null(zval *arg, uint idx);
ZEND_API int add_index_bool(zval *arg, uint idx, int b);
ZEND_API int add_index_resource(zval *arg, uint idx, int r);
ZEND_API int add_index_double(zval *arg, uint idx, double d);
@@ -174,7 +180,7 @@ ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int
ZEND_API int add_index_zval(zval *arg, uint index, zval *value);
ZEND_API int add_next_index_long(zval *arg, long n);
-ZEND_API int add_next_index_unset(zval *arg);
+ZEND_API int add_next_index_null(zval *arg);
ZEND_API int add_next_index_bool(zval *arg, int b);
ZEND_API int add_next_index_resource(zval *arg, int r);
ZEND_API int add_next_index_double(zval *arg, double d);
@@ -194,7 +200,7 @@ ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, i
ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long l);
-ZEND_API int add_property_unset_ex(zval *arg, char *key, uint key_len);
+ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len);
ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b);
ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long r);
ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d);
@@ -203,7 +209,7 @@ ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *
ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value);
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n)
-#define add_property_unset(__arg, __key) add_property_unset_ex(__arg, __key, strlen(__key) + 1)
+#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r)
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d)
4 ext/ingres_ii/ii.c
@@ -1065,10 +1065,10 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
if(columnData[k-1].dv_null) { /* NULL value ? */
if(result_type & II_NUM) {
- add_index_unset(return_value, i+k-1);
+ add_index_null(return_value, i+k-1);
if(result_type & II_ASSOC) {
- add_assoc_unset(return_value, php_ii_field_name(ii_link, i+k-1));
+ add_assoc_null(return_value, php_ii_field_name(ii_link, i+k-1));
} else { /* non NULL value */
4 ext/mysql/php_mysql.c
@@ -1425,9 +1425,9 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
} else {
/* NULL value. */
if (result_type & MYSQL_NUM)
- add_index_unset(return_value, i);
+ add_index_null(return_value, i);
- add_assoc_unset(return_value, mysql_field->name);
+ add_assoc_null(return_value, mysql_field->name);
4 ext/pgsql/pgsql.c
@@ -1049,11 +1049,11 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
for (i = 0, num_fields = PQnfields(pgsql_result); i<num_fields; i++) {
if (PQgetisnull(pgsql_result, Z_LVAL_PP(row), i)) {
if (result_type & PGSQL_NUM) {
- add_index_unset(return_value, i);
+ add_index_null(return_value, i);
if (result_type & PGSQL_ASSOC) {
field_name = PQfname(pgsql_result, i);
- add_assoc_unset(return_value, field_name);
+ add_assoc_null(return_value, field_name);
} else {
element = PQgetvalue(pgsql_result, Z_LVAL_PP(row), i);
2 ext/standard/scanf.c
@@ -663,7 +663,7 @@ PHPAPI int php_sscanf_internal( char *string,char *format,
return FAILURE;
for (i = 0; i < totalVars; i++) {
- if (add_next_index_unset(*return_value) == FAILURE) {
+ if (add_next_index_null(*return_value) == FAILURE) {
scan_set_error_return(0, return_value);
return FAILURE;

0 comments on commit 0611acb

Please sign in to comment.
Something went wrong with that request. Please try again.