Skip to content

Commit

Permalink
Merge branch 'PHP-7.0'
Browse files Browse the repository at this point in the history
Conflicts:
	Zend/zend_builtin_functions.c
  • Loading branch information
nikic committed May 5, 2016
2 parents 26adba3 + 8e5b381 commit 59f35c0
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,23 +755,22 @@ ZEND_FUNCTION(each)
Return the current error_reporting level, and if an argument was passed - change to the new level */
ZEND_FUNCTION(error_reporting)
{
zval *err = NULL;
zend_long err;
int old_error_reporting;

#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &err) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL(err)
Z_PARAM_LONG(err)
ZEND_PARSE_PARAMETERS_END();
#endif

old_error_reporting = EG(error_reporting);
if (ZEND_NUM_ARGS() != 0) {
zend_string *new_val = zval_get_string(err);
do {
zend_ini_entry *p = EG(error_reporting_ini_entry);

Expand All @@ -797,12 +796,8 @@ ZEND_FUNCTION(error_reporting)
zend_string_release(p->value);
}

p->value = new_val;
if (Z_TYPE_P(err) == IS_LONG) {
EG(error_reporting) = Z_LVAL_P(err);
} else {
EG(error_reporting) = atoi(ZSTR_VAL(p->value));
}
p->value = zend_long_to_str(err);
EG(error_reporting) = err;
} while (0);
}

Expand Down

0 comments on commit 59f35c0

Please sign in to comment.