Browse Source

Dropped allow_call_time_pass_reference, the error is maden E_STRICT.

migration/RELEASE_1_0_0
Dmitry Stogov 21 years ago
parent
commit
9d7ca01c8b
  1. 1
      NEWS
  2. 1
      Zend/zend.c
  3. 29
      Zend/zend_compile.c
  4. 1
      Zend/zend_globals.h
  5. 5
      ext/standard/tests/array/bug33940.phpt
  6. 1
      main/main.c
  7. 1
      main/php_globals.h

1
NEWS

@ -4,6 +4,7 @@ PHP NEWS
- Unicode support. (Andrei, Dmitry, et al)
- Dropped safe_mode support (Ilia, Andi)
- Dropped zend.ze1_compatibility_mode (Dmitry)
- Dropped allow_call_time_pass_reference, the error is maden E_STRICT. (Dmitry)
- Dropped register_long_arrays (Dmitry)
- Droped register_globals support (Pierre)
- session_register, session_unregister and session_is_registered removed they

1
Zend/zend.c

@ -673,7 +673,6 @@ static void zend_set_default_compile_time_values(TSRMLS_D)
/* default compile-time values */
CG(asp_tags) = 0;
CG(short_tags) = 1;
CG(allow_call_time_pass_reference) = 1;
CG(extended_info) = 0;
}

29
Zend/zend_compile.c

@ -1642,19 +1642,22 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
if (original_op==ZEND_SEND_REF
&& !CG(allow_call_time_pass_reference)) {
zend_error(E_COMPILE_WARNING,
"Call-time pass-by-reference has been deprecated - argument passed by value; "
"If you would like to pass it by reference, modify the declaration of %R(). "
"If you would like to enable call-time pass-by-reference, you can set "
"allow_call_time_pass_reference to true in your INI file. "
"However, future versions may not support this any longer. ",
(function_ptr && UG(unicode))?IS_UNICODE:IS_STRING,
(function_ptr?function_ptr->common.function_name.s:"[runtime function name]"));
}
if (function_ptr) {
if (original_op==ZEND_SEND_REF) {
if (function_ptr &&
function_ptr->common.function_name.v &&
function_ptr->common.type == ZEND_USER_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
zend_error(E_STRICT,
"Call-time pass-by-reference has been deprecated; "
"if you would like to pass argument by reference, modify the declaration of %R().",
UG(unicode)?IS_UNICODE:IS_STRING,
function_ptr->common.function_name.v);
} else{
zend_error(E_STRICT,
"Call-time pass-by-reference has been deprecated");
}
send_by_reference = 1;
} else if (function_ptr) {
if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
send_by_reference = 0;

1
Zend/zend_globals.h

@ -101,7 +101,6 @@ struct _zend_compiler_globals {
zend_bool in_compilation;
zend_bool short_tags;
zend_bool asp_tags;
zend_bool allow_call_time_pass_reference;
zend_declarables declarables;

5
ext/standard/tests/array/bug33940.phpt

@ -24,7 +24,10 @@ $ret = array_map('ref_map', &$a);
echo 'Array: '; print_r($a);
echo 'Return: '; print_r($ret);
?>
--EXPECT--
--EXPECTF--
Strict Standards: Call-time pass-by-reference has been deprecated in %sbug33940.php on line 7
Strict Standards: Call-time pass-by-reference has been deprecated in %sbug33940.php on line 17
Array: Array
(
[0] => Array

1
main/main.c

@ -349,7 +349,6 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, allow_call_time_pass_reference, zend_compiler_globals, compiler_globals)
STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, asp_tags, zend_compiler_globals, compiler_globals)
STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateBool, display_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("display_startup_errors", "0", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals)

1
main/php_globals.h

@ -50,7 +50,6 @@ typedef struct _arg_separators {
} arg_separators;
struct _php_core_globals {
zend_bool allow_call_time_pass_reference;
zend_bool implicit_flush;
long output_buffering;

Loading…
Cancel
Save