mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts: Zend/zend_language_scanner.c Zend/zend_language_scanner.l
This commit is contained in:
@@ -1861,7 +1861,7 @@ PHPAPI HashTable* php_splice(HashTable *in_hash, int offset, int length, zval *l
|
||||
/* ..for each one, create a new zval, copy entry into it and copy it into the output hash */
|
||||
for (i = 0; i < list_count; i++) {
|
||||
entry = &list[i];
|
||||
Z_ADDREF_P(entry);
|
||||
if (IS_REFCOUNTED(Z_TYPE_P(entry))) Z_ADDREF_P(entry);
|
||||
zend_hash_next_index_insert(out_hash, entry);
|
||||
}
|
||||
}
|
||||
@@ -1871,7 +1871,7 @@ PHPAPI HashTable* php_splice(HashTable *in_hash, int offset, int length, zval *l
|
||||
p = in_hash->arData + idx;
|
||||
if (Z_TYPE(p->val) == IS_UNDEF) continue;
|
||||
entry = &p->val;
|
||||
Z_ADDREF_P(entry);
|
||||
if (IS_REFCOUNTED(Z_TYPE_P(entry))) Z_ADDREF_P(entry);
|
||||
if (p->key == NULL) {
|
||||
zend_hash_next_index_insert(out_hash, entry);
|
||||
} else {
|
||||
|
||||
+12
-12
@@ -90,34 +90,34 @@ PHP_FUNCTION(gettype)
|
||||
Set the type of the variable */
|
||||
PHP_FUNCTION(settype)
|
||||
{
|
||||
zval **var;
|
||||
zval *var;
|
||||
char *type;
|
||||
int type_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs", &var, &type, &type_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &var, &type, &type_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcasecmp(type, "integer")) {
|
||||
convert_to_long(*var);
|
||||
convert_to_long(var);
|
||||
} else if (!strcasecmp(type, "int")) {
|
||||
convert_to_long(*var);
|
||||
convert_to_long(var);
|
||||
} else if (!strcasecmp(type, "float")) {
|
||||
convert_to_double(*var);
|
||||
convert_to_double(var);
|
||||
} else if (!strcasecmp(type, "double")) { /* deprecated */
|
||||
convert_to_double(*var);
|
||||
convert_to_double(var);
|
||||
} else if (!strcasecmp(type, "string")) {
|
||||
convert_to_string(*var);
|
||||
convert_to_string(var);
|
||||
} else if (!strcasecmp(type, "array")) {
|
||||
convert_to_array(*var);
|
||||
convert_to_array(var);
|
||||
} else if (!strcasecmp(type, "object")) {
|
||||
convert_to_object(*var);
|
||||
convert_to_object(var);
|
||||
} else if (!strcasecmp(type, "bool")) {
|
||||
convert_to_boolean(*var);
|
||||
convert_to_boolean(var);
|
||||
} else if (!strcasecmp(type, "boolean")) {
|
||||
convert_to_boolean(*var);
|
||||
convert_to_boolean(var);
|
||||
} else if (!strcasecmp(type, "null")) {
|
||||
convert_to_null(*var);
|
||||
convert_to_null(var);
|
||||
} else if (!strcasecmp(type, "resource")) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type");
|
||||
RETURN_FALSE;
|
||||
|
||||
Reference in New Issue
Block a user