summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-05-05 17:31:25 +0200
committerNikita Popov <nikic@php.net>2016-05-05 17:31:25 +0200
commit59f35c0ca9abfa72c5393f6c0350759a3f6512d8 (patch)
tree50865794891a5d78c5cce2c633ff8eee1a10c478
parent26adba38bc53e539c752f59ba8a10efb914936c2 (diff)
parent8e5b38100411d3b8fa4486c7c41dec7dedb4b474 (diff)
downloadphp-git-59f35c0ca9abfa72c5393f6c0350759a3f6512d8.tar.gz
Merge branch 'PHP-7.0'
Conflicts: Zend/zend_builtin_functions.c
-rw-r--r--Zend/zend_builtin_functions.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 6e251f6109..6434049a4f 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -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);
@@ -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);
}