summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UPGRADING7
-rw-r--r--Zend/zend_vm_def.h6
-rw-r--r--Zend/zend_vm_execute.h6
-rw-r--r--ext/standard/info.c6
4 files changed, 18 insertions, 7 deletions
diff --git a/UPGRADING b/UPGRADING
index 544c8c0e48..d2be2afd5d 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -35,6 +35,13 @@ PHP X.Y UPGRADE NOTES
. Removed ASP (<%) and script (<script language=php>) tags.
(RFC: https://wiki.php.net/rfc/remove_alternative_php_tags)
. call_user_method() and call_user_method_array() no longer exists.
+ . PHP 7 doesn't keep original values of arguments passed to user functions,
+ so func_get_arg() and func_get_args() will return current value of argument
+ instead of the actually passed. The following code is going to be affected:
+ function foo($x) { $x = 2; return func_get_arg(0);} var_dump(foo(1));
+ It will now produce 2, not 1.
+ . Function parameters with duplicate name are not allowed anymore. Definitions
+ like “function foo($x,$x) {}” will lead to compile time error.
- DBA
. dba_delete() now returns false if the key was not found for the inifile
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 1e0cda1ef6..039020943a 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2771,9 +2771,11 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
LOAD_OPLINE();
if (UNEXPECTED(fbc->type == ZEND_INTERNAL_FUNCTION)) {
+ int should_change_scope = 0;
zval *ret;
if (fbc->common.scope) {
+ should_change_scope = 1;
/* TODO: we don't set scope if we call an object method ??? */
/* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */
#if 1
@@ -2804,7 +2806,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
if (RETURN_VALUE_USED(opline)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
}
- if (UNEXPECTED(fbc->common.scope)) {
+ if (UNEXPECTED(should_change_scope)) {
ZEND_VM_C_GOTO(fcall_end_change_scope);
} else {
ZEND_VM_C_GOTO(fcall_end);
@@ -2830,7 +2832,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
zval_ptr_dtor(ret);
}
- if (UNEXPECTED(fbc->common.scope)) {
+ if (UNEXPECTED(should_change_scope)) {
ZEND_VM_C_GOTO(fcall_end_change_scope);
} else {
ZEND_VM_C_GOTO(fcall_end);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index d245738c4e..5b1d22edcc 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -513,9 +513,11 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
LOAD_OPLINE();
if (UNEXPECTED(fbc->type == ZEND_INTERNAL_FUNCTION)) {
+ int should_change_scope = 0;
zval *ret;
if (fbc->common.scope) {
+ should_change_scope = 1;
/* TODO: we don't set scope if we call an object method ??? */
/* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */
#if 1
@@ -546,7 +548,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (RETURN_VALUE_USED(opline)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
}
- if (UNEXPECTED(fbc->common.scope)) {
+ if (UNEXPECTED(should_change_scope)) {
goto fcall_end_change_scope;
} else {
goto fcall_end;
@@ -572,7 +574,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval_ptr_dtor(ret);
}
- if (UNEXPECTED(fbc->common.scope)) {
+ if (UNEXPECTED(should_change_scope)) {
goto fcall_end_change_scope;
} else {
goto fcall_end;
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 912ac51601..cc332721a4 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -37,7 +37,8 @@
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
-
+#include "url.h"
+#include "php_string.h"
#ifdef PHP_WIN32
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
@@ -143,8 +144,7 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */
{
if (zend_module->info_func || zend_module->version) {
if (!sapi_module.phpinfo_as_text) {
- int len = 0;
- zend_string *url_name = php_url_encode(zend_module->name, strlen(zend_module->name), &len);
+ zend_string *url_name = php_url_encode(zend_module->name, strlen(zend_module->name));
php_strtolower(url_name->val, url_name->len);
php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", url_name->val, zend_module->name);