Skip to content

Commit 59f35c0

Browse files
committed
Merge branch 'PHP-7.0'
Conflicts: Zend/zend_builtin_functions.c
2 parents 26adba3 + 8e5b381 commit 59f35c0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

Zend/zend_builtin_functions.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -755,23 +755,22 @@ ZEND_FUNCTION(each)
755755
Return the current error_reporting level, and if an argument was passed - change to the new level */
756756
ZEND_FUNCTION(error_reporting)
757757
{
758-
zval *err = NULL;
758+
zend_long err;
759759
int old_error_reporting;
760760

761761
#ifndef FAST_ZPP
762-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
762+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &err) == FAILURE) {
763763
return;
764764
}
765765
#else
766766
ZEND_PARSE_PARAMETERS_START(0, 1)
767767
Z_PARAM_OPTIONAL
768-
Z_PARAM_ZVAL(err)
768+
Z_PARAM_LONG(err)
769769
ZEND_PARSE_PARAMETERS_END();
770770
#endif
771771

772772
old_error_reporting = EG(error_reporting);
773773
if (ZEND_NUM_ARGS() != 0) {
774-
zend_string *new_val = zval_get_string(err);
775774
do {
776775
zend_ini_entry *p = EG(error_reporting_ini_entry);
777776

@@ -797,12 +796,8 @@ ZEND_FUNCTION(error_reporting)
797796
zend_string_release(p->value);
798797
}
799798

800-
p->value = new_val;
801-
if (Z_TYPE_P(err) == IS_LONG) {
802-
EG(error_reporting) = Z_LVAL_P(err);
803-
} else {
804-
EG(error_reporting) = atoi(ZSTR_VAL(p->value));
805-
}
799+
p->value = zend_long_to_str(err);
800+
EG(error_reporting) = err;
806801
} while (0);
807802
}
808803

0 commit comments

Comments
 (0)