diff options
| author | Felipe Pena <felipe@php.net> | 2010-04-26 00:13:34 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-04-26 00:13:34 +0000 |
| commit | 0a6bcd44a72197bc8fb5658ce9fe4b46019ab9b3 (patch) | |
| tree | b015404b606eda42e2573e7a412c9b5518c5fa0a /Zend | |
| parent | 7211284ac7f217694f2f351ec223f94af7db0d16 (diff) | |
| download | php-git-0a6bcd44a72197bc8fb5658ce9fe4b46019ab9b3.tar.gz | |
- Removed allow_call_time_pass_reference (Pierrick)
Diffstat (limited to 'Zend')
| -rw-r--r-- | Zend/tests/magic_by_ref_010.phpt | 30 | ||||
| -rw-r--r-- | Zend/zend.c | 4 | ||||
| -rw-r--r-- | Zend/zend_compile.c | 18 | ||||
| -rw-r--r-- | Zend/zend_globals.h | 1 |
4 files changed, 9 insertions, 44 deletions
diff --git a/Zend/tests/magic_by_ref_010.phpt b/Zend/tests/magic_by_ref_010.phpt index 0a45fb9113..e69de29bb2 100644 --- a/Zend/tests/magic_by_ref_010.phpt +++ b/Zend/tests/magic_by_ref_010.phpt @@ -1,30 +0,0 @@ ---TEST-- -passing arguments by ref to a method handled by __call() ---INI-- -allow_call_time_pass_reference=1 ---FILE-- -<?php - -class Foo { - function __call($method, $args) - { - print $args[0]."\n"; - $args[0] = 5; - print $args[0]."\n"; - return true; - } -} - -$v = 'str'; -$o = new Foo(); -$o->test(&$v); - -var_dump($v); - -echo "Done\n"; -?> ---EXPECTF-- -str -5 -int(5) -Done diff --git a/Zend/zend.c b/Zend/zend.c index bd48e52223..0fbe847d80 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -442,12 +442,10 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_ #ifdef ZTS static zend_bool asp_tags_default = 0; static zend_bool short_tags_default = 1; -static zend_bool ct_pass_ref_default = 1; static zend_uint compiler_options_default = ZEND_COMPILE_DEFAULT; #else # define asp_tags_default 0 # define short_tags_default 1 -# define ct_pass_ref_default 1 # define compiler_options_default ZEND_COMPILE_DEFAULT #endif @@ -456,7 +454,6 @@ static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */ /* default compile-time values */ CG(asp_tags) = asp_tags_default; CG(short_tags) = short_tags_default; - CG(allow_call_time_pass_reference) = ct_pass_ref_default; CG(compiler_options) = compiler_options_default; } /* }}} */ @@ -744,7 +741,6 @@ void zend_post_startup(TSRMLS_D) /* {{{ */ asp_tags_default = CG(asp_tags); short_tags_default = CG(short_tags); - ct_pass_ref_default = CG(allow_call_time_pass_reference); compiler_options_default = CG(compiler_options); zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 4ee458e5cc..9ba45f36ed 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2335,21 +2335,21 @@ 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)) { + if (original_op == ZEND_SEND_REF) { if (function_ptr && function_ptr->common.function_name && function_ptr->common.type == ZEND_USER_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { - zend_error(E_DEPRECATED, - "Call-time pass-by-reference has been deprecated; " - "If you would like to pass it by reference, modify the declaration of %s(). " - "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", function_ptr->common.function_name); + zend_error(E_COMPILE_ERROR, + "Call-time pass-by-reference has been removed; " + "If you would like to pass argument by reference, modify the declaration of %s().", + function_ptr->common.function_name); } else { - zend_error(E_DEPRECATED, "Call-time pass-by-reference has been deprecated"); + zend_error(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed"); } - } - + return; + } + if (function_ptr) { if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { if (param->op_type & (IS_VAR|IS_CV)) { diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 19be67d1de..010a0db8e5 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -104,7 +104,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; |
