summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 60ef092bb1..6c023f474d 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -201,7 +201,8 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D) /* {{{ */
ZEND_API char *zend_get_type_by_const(int type) /* {{{ */
{
switch(type) {
- case IS_BOOL:
+ case IS_FALSE:
+ case IS_TRUE:
return "boolean";
case IS_LONG:
return "integer";
@@ -408,8 +409,9 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
}
}
case IS_NULL:
+ case IS_FALSE:
+ case IS_TRUE:
case IS_LONG:
- case IS_BOOL:
convert_to_long_ex(arg);
*p = Z_LVAL_P(arg);
break;
@@ -447,9 +449,10 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
break;
case IS_NULL:
+ case IS_FALSE:
+ case IS_TRUE:
case IS_LONG:
case IS_DOUBLE:
- case IS_BOOL:
convert_to_double_ex(arg);
*p = Z_DVAL_P(arg);
break;
@@ -480,7 +483,8 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
case IS_STRING:
case IS_LONG:
case IS_DOUBLE:
- case IS_BOOL:
+ case IS_FALSE:
+ case IS_TRUE:
convert_to_string_ex(arg);
if (UNEXPECTED(Z_ISREF_P(arg))) {
/* it's dangerous to return pointers to string
@@ -525,7 +529,8 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
case IS_STRING:
case IS_LONG:
case IS_DOUBLE:
- case IS_BOOL:
+ case IS_FALSE:
+ case IS_TRUE:
convert_to_string_ex(arg);
if (UNEXPECTED(Z_ISREF_P(arg))) {
/* it's dangerous to return pointers to string
@@ -563,9 +568,10 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
case IS_STRING:
case IS_LONG:
case IS_DOUBLE:
- case IS_BOOL:
+ case IS_FALSE:
+ case IS_TRUE:
convert_to_boolean_ex(arg);
- *p = Z_BVAL_P(arg);
+ *p = Z_TYPE_P(arg) == IS_TRUE;
break;
case IS_ARRAY:
@@ -1641,7 +1647,12 @@ ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC)
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_RES_HANDLE_P(key), Z_RES_HANDLE_P(key));
result = zend_hash_index_update(ht, Z_RES_HANDLE_P(key), value);
break;
- case IS_BOOL:
+ case IS_FALSE:
+ result = zend_hash_index_update(ht, 0, value);
+ break;
+ case IS_TRUE:
+ result = zend_hash_index_update(ht, 1, value);
+ break;
case IS_LONG:
result = zend_hash_index_update(ht, Z_LVAL_P(key), value);
break;
@@ -3954,8 +3965,9 @@ static int same_zval(zval *zv1, zval *zv2) /* {{{ */
switch (Z_TYPE_P(zv1)) {
case IS_UNDEF:
case IS_NULL:
+ case IS_FALSE:
+ case IS_TRUE:
return 1;
- case IS_BOOL:
case IS_LONG:
return Z_LVAL_P(zv1) == Z_LVAL_P(zv2);
case IS_DOUBLE: