felipe                                   Mon, 26 Apr 2010 00:13:34 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=298567

Log:
- Removed allow_call_time_pass_reference (Pierrick)

Changed paths:
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/tests/magic_by_ref_010.phpt
    U   php/php-src/trunk/Zend/zend.c
    U   php/php-src/trunk/Zend/zend_compile.c
    U   php/php-src/trunk/Zend/zend_globals.h
    U   php/php-src/trunk/ext/spl/tests/array_004.phpt
    U   php/php-src/trunk/ext/spl/tests/array_008.phpt
    U   php/php-src/trunk/ext/spl/tests/dllist_001.phpt
    U   php/php-src/trunk/ext/spl/tests/dllist_004.phpt
    U   php/php-src/trunk/ext/spl/tests/dllist_005.phpt
    U   php/php-src/trunk/ext/spl/tests/fixedarray_001.phpt
    U   php/php-src/trunk/ext/spl/tests/fixedarray_002.phpt
    U   
php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation7.phpt
    U   
php/php-src/trunk/ext/standard/tests/array/array_key_exists_variation4.phpt
    U   php/php-src/trunk/ext/standard/tests/array/array_merge_variation9.phpt
    U   php/php-src/trunk/ext/standard/tests/array/array_push_variation4.phpt
    U   php/php-src/trunk/ext/standard/tests/array/array_slice_variation9.phpt
    U   php/php-src/trunk/ext/standard/tests/array/array_values_variation6.phpt
    U   php/php-src/trunk/ext/standard/tests/array/bug33940.phpt
    U   php/php-src/trunk/ext/standard/tests/array/each_variation4.phpt
    U   php/php-src/trunk/ext/standard/tests/array/rsort_variation4.phpt
    U   
php/php-src/trunk/ext/standard/tests/general_functions/debug_zval_dump_v.phpt
    U   php/php-src/trunk/main/main.c
    U   php/php-src/trunk/main/php_globals.h
    U   php/php-src/trunk/php.ini-development
    U   php/php-src/trunk/php.ini-production

Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/NEWS	2010-04-26 00:13:34 UTC (rev 298567)
@@ -34,17 +34,18 @@
 - Changed session.entropy_file to default to /dev/urandom or /dev/arandom if either
   is present at compile time. (Rasmus)

-- Removed legacy features: (Kalle)
-  . define_syslog_variables ini option and its associated function.
-  . highlight.bg ini option.
-  . import_request_variables().
-  . register_globals.
-  . register_long_arrays ini option.
+- Removed legacy features:
+  . define_syslog_variables ini option and its associated function. (Kalle)
+  . highlight.bg ini option. (Kalle)
+  . import_request_variables(). (Kalle)
+  . register_globals. (Kalle)
+  . allow_call_time_pass_reference. (Pierrick)
+  . register_long_arrays ini option. (Kalle)
   . Session bug compatibility mode (session.bug_compat42 and
-    session.bug_compat_warn ini options).
+    session.bug_compat_warn ini options). (Kalle)
   . session_is_registered(), session_register() and session_unregister()
-    functions.
-  . y2k_compliance ini option.
+    functions. (Kalle)
+  . y2k_compliance ini option. (Kalle)

 ?? ??? 20??, PHP 5.3.3
 - Upgraded bundled PCRE to version 8.01. (Ilia)

Modified: php/php-src/trunk/Zend/tests/magic_by_ref_010.phpt
===================================================================
--- php/php-src/trunk/Zend/tests/magic_by_ref_010.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/Zend/tests/magic_by_ref_010.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -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

Modified: php/php-src/trunk/Zend/zend.c
===================================================================
--- php/php-src/trunk/Zend/zend.c	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/Zend/zend.c	2010-04-26 00:13:34 UTC (rev 298567)
@@ -442,12 +442,10 @@
 #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 @@
 	/* 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 @@

 	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);

Modified: php/php-src/trunk/Zend/zend_compile.c
===================================================================
--- php/php-src/trunk/Zend/zend_compile.c	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/Zend/zend_compile.c	2010-04-26 00:13:34 UTC (rev 298567)
@@ -2335,21 +2335,21 @@
 	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)) {

Modified: php/php-src/trunk/Zend/zend_globals.h
===================================================================
--- php/php-src/trunk/Zend/zend_globals.h	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/Zend/zend_globals.h	2010-04-26 00:13:34 UTC (rev 298567)
@@ -104,7 +104,6 @@
 	zend_bool in_compilation;
 	zend_bool short_tags;
 	zend_bool asp_tags;
-	zend_bool allow_call_time_pass_reference;

 	zend_declarables declarables;


Modified: php/php-src/trunk/ext/spl/tests/array_004.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/array_004.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/array_004.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,12 +1,8 @@
 --TEST--
 SPL: ArrayIterator
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php

-echo "==Normal==\n";
-
 $arr = array(0=>0, 1=>1, 2=>2);
 $obj = new ArrayObject($arr);

@@ -19,66 +15,9 @@
 	}
 }

-echo "==UseRef==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new ArrayObject(&$arr);
-
-foreach($obj as $ak=>$av) {
-	foreach($obj as $bk=>$bv) {
-		if ($ak==0 && $bk==0) {
-			$arr[0] = "modify";
-		}
-		echo "$ak=>$av - $bk=>$bv\n";
-	}
-}
-
-echo "==Modify==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new ArrayObject(&$arr);
-
-foreach($obj as $ak=>$av) {
-	foreach($obj as $bk=>$bv) {
-		if ($ak==0 && $bk==0) {
-			$arr[0] = "modify";
-		}
-		echo "$ak=>$av - $bk=>$bv\n";
-	}
-}
-
-echo "==Delete==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new ArrayObject(&$arr);
-
-foreach($obj as $ak=>$av) {
-	foreach($obj as $bk=>$bv) {
-		if ($ak==1 && $bk==1) {
-			unset($arr[1]);
-		}
-		echo "$ak=>$av - $bk=>$bv\n";
-	}
-}
-
-echo "==Change==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new ArrayObject(&$arr);
-
-foreach($obj as $ak=>$av) {
-	foreach($obj as $bk=>$bv) {
-		if ($ak==1 && $bk==1) {
-			$arr = NULL;
-		}
-		echo "$ak=>$av - $bk=>$bv\n";
-	}
-}
-
 echo "Done\n";
 ?>
 --EXPECTF--
-==Normal==
 0=>0 - 0=>0
 0=>0 - 1=>1
 0=>0 - 2=>2
@@ -88,54 +27,4 @@
 2=>2 - 0=>0
 2=>2 - 1=>1
 2=>2 - 2=>2
-==UseRef==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>modify
-1=>1 - 1=>1
-1=>1 - 2=>2
-2=>2 - 0=>modify
-2=>2 - 1=>1
-2=>2 - 2=>2
-==Modify==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>modify
-1=>1 - 1=>1
-1=>1 - 2=>2
-2=>2 - 0=>modify
-2=>2 - 1=>1
-2=>2 - 2=>2
-==Delete==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>0
-1=>1 - 1=>1
-
-Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_004.php on line %d
-1=>1 - 0=>0
-1=>1 - 2=>2
-
-Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_004.php on line %d
-0=>0 - 0=>0
-0=>0 - 2=>2
-2=>2 - 0=>0
-2=>2 - 2=>2
-==Change==
-0=>0 - 0=>0
-0=>0 - 1=>1
-0=>0 - 2=>2
-1=>1 - 0=>0
-1=>1 - 1=>1
-
-Notice: main(): ArrayIterator::current(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d
-
-Notice: main(): ArrayIterator::valid(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d
-
-Notice: main(): ArrayIterator::current(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d
-
-Notice: main(): ArrayIterator::valid(): Array was modified outside object and is no longer an array in %sarray_004.php on line %d
 Done

Modified: php/php-src/trunk/ext/spl/tests/array_008.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/array_008.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/array_008.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,12 +1,8 @@
 --TEST--
 SPL: ArrayIterator and foreach reference
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php

-echo "==Normal==\n";
-
 $arr = array(0=>0, 1=>1, 2=>2);
 $obj = new ArrayObject($arr);

@@ -19,25 +15,10 @@
 	}
 }

-echo "==UseRef==\n";
-
-$arr = array(0=>0, 1=>1, 2=>2);
-$obj = new ArrayObject(&$arr);
-
-foreach($obj as $ak=>&$av) {
-	foreach($obj as $bk=>&$bv) {
-		if ($ak==0 && $bk==0) {
-			$bv = "modify";
-		}
-		echo "$ak=>$av - $bk=>$bv\n";
-	}
-}
-
 ?>
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-==Normal==
 0=>modify - 0=>modify
 0=>modify - 1=>1
 0=>modify - 2=>2
@@ -47,14 +28,4 @@
 2=>2 - 0=>modify
 2=>2 - 1=>1
 2=>2 - 2=>2
-==UseRef==
-0=>modify - 0=>modify
-0=>modify - 1=>1
-0=>modify - 2=>2
-1=>1 - 0=>modify
-1=>1 - 1=>1
-1=>1 - 2=>2
-2=>2 - 0=>modify
-2=>2 - 1=>1
-2=>2 - 2=>2
 ===DONE===

Modified: php/php-src/trunk/ext/spl/tests/dllist_001.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/dllist_001.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/dllist_001.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 SPL: DoublyLinkedList: std operations
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php
 $dll = new SplDoublyLinkedList();
@@ -20,19 +18,11 @@
 // data consistency
 $a = 2;
 $dll->push($a);
-$a = 3;
-$dll->push(&$a);
-$a = 4;
 echo $dll->pop()."\n";
-echo $dll->pop()."\n";

 $a = 2;
 $dll->unshift($a);
-$a = 3;
-$dll->unshift(&$a);
-$a = 4;
 echo $dll->shift()."\n";
-echo $dll->shift()."\n";

 // peakable
 $dll->push(1);
@@ -61,9 +51,7 @@
 --EXPECTF--
 Exception: Can't pop from an empty datastructure
 Exception: Can't shift from an empty datastructure
-3
 2
-3
 2
 2
 1

Modified: php/php-src/trunk/ext/spl/tests/dllist_004.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/dllist_004.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/dllist_004.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 SPL: DoublyLinkedList: Stacks
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php
 $stack = new SplStack();
@@ -20,11 +18,7 @@
 // data consistency
 $a = 2;
 $stack->push($a);
-$a = 3;
-$stack->push(&$a);
-$a = 4;
 echo $stack->pop()."\n";
-echo $stack->pop()."\n";

 // peakable
 $stack->push(1);
@@ -55,7 +49,6 @@
 --EXPECTF--
 Exception: Can't pop from an empty datastructure
 Exception: Can't shift from an empty datastructure
-3
 2
 2
 [2]

Modified: php/php-src/trunk/ext/spl/tests/dllist_005.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/dllist_005.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/dllist_005.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 SPL: DoublyLinkedList: Queues
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php
 $queue = new SplQueue();
@@ -20,11 +18,7 @@
 // data consistency
 $a = 2;
 $queue->enqueue($a);
-$a = 3;
-$queue->enqueue(&$a);
-$a = 4;
 echo $queue->dequeue()."\n";
-echo $queue->dequeue()."\n";

 // peakable
 $queue->enqueue(1);
@@ -56,7 +50,6 @@
 Exception: Can't shift from an empty datastructure
 Exception: Can't shift from an empty datastructure
 2
-3
 2
 [1]
 [2]

Modified: php/php-src/trunk/ext/spl/tests/fixedarray_001.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/fixedarray_001.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/fixedarray_001.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 SPL: FixedArray: std operations
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php
 $a = new SplFixedArray(0);

Modified: php/php-src/trunk/ext/spl/tests/fixedarray_002.phpt
===================================================================
--- php/php-src/trunk/ext/spl/tests/fixedarray_002.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/spl/tests/fixedarray_002.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 SPL: FixedArray: overloading
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php
 class A extends SplFixedArray {

Modified: php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation7.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation7.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/array_change_key_case_variation7.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test array_change_key_case() function : usage variations - referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : array array_change_key_case(array $input [, int $case])
@@ -28,12 +26,6 @@
 echo "Referenced:\n";
 var_dump($new_input);

-echo "\n-- \$input is an array passed by reference --\n";
-echo "Result:\n";
-var_dump(array_change_key_case(&$input, CASE_UPPER));
-echo "Original:\n";
-var_dump($input);
-
 echo "Done";
 ?>

@@ -68,25 +60,5 @@
   ["ABC"]=>
   string(3) "xyz"
 }
-
--- $input is an array passed by reference --
-Result:
-array(3) {
-  ["ONE"]=>
-  int(1)
-  ["TWO"]=>
-  int(2)
-  ["ABC"]=>
-  string(3) "xyz"
-}
-Original:
-array(3) {
-  ["one"]=>
-  int(1)
-  ["two"]=>
-  int(2)
-  ["ABC"]=>
-  string(3) "xyz"
-}
 Done


Modified: php/php-src/trunk/ext/standard/tests/array/array_key_exists_variation4.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/array_key_exists_variation4.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/array_key_exists_variation4.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test array_key_exists() function : usage variations - referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : bool array_key_exists(mixed $key, array $search)
@@ -22,13 +20,6 @@
 $search = &$array;
 var_dump(array_key_exists('one', $search));

-echo "\n-- \$key is a referenced variable --\n";
-$key = 'two';
-var_dump(array_key_exists(&$key, $array));
-
-echo "\n-- Both arguments are referenced variables --\n";
-var_dump(array_key_exists(&$key, &$array));
-
 echo "Done";
 ?>

@@ -37,10 +28,4 @@

 -- $search is a reference to $array --
 bool(true)
-
--- $key is a referenced variable --
-bool(true)
-
--- Both arguments are referenced variables --
-bool(true)
 Done

Modified: php/php-src/trunk/ext/standard/tests/array/array_merge_variation9.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/array_merge_variation9.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/array_merge_variation9.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test array_merge() function : usage variations - referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : array array_merge(array $arr1, array $arr2 [, array $...])
@@ -33,9 +31,6 @@
 var_dump(array_merge($arr1, $arr2));
 var_dump(array_merge($arr2, $arr1));

-echo "\n-- Merge an array and a reference to the first array --\n";
-var_dump(array_merge($arr2, &$arr2));
-
 echo "Done";
 ?>

@@ -101,14 +96,4 @@
   [2]=>
   &string(3) "baz"
 }
-
--- Merge an array and a reference to the first array --
-array(3) {
-  ["key1"]=>
-  string(4) "val1"
-  ["key2"]=>
-  string(4) "val2"
-  ["key3"]=>
-  string(4) "val3"
-}
 Done

Modified: php/php-src/trunk/ext/standard/tests/array/array_push_variation4.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/array_push_variation4.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/array_push_variation4.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,110 +0,0 @@
---TEST--
-Test array_push() function : usage variations - referenced variables
---INI--
-allow_call_time_pass_reference=on
---FILE--
-<?php
-/* Prototype  : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
-/*
- * Test array_push when:
- * 1. passed referenced variables as $var arguments
- * 2. $var argument is a reference to $stack argument
- */
-
-echo "*** Testing array_push() : usage variations ***\n";
-
-$var1 = 'a';
-$var2 = 'b';
-$var3 = 'c';
-$var4 = 'x';
-$var5 = 'y';
-$var6 = 'z';
-
-$array = array(1, 2, 3);
-
-echo "\n-- Pass array_push referenced varialbes as \$var arguments --\n";
-var_dump(array_push($array, &$var1, &$var2, &$var3, &$var4, &$var5, &$var6));
-var_dump($array);
-
-echo "\n-- Pass \$var argument which is a reference to \$stack argument --\n";
-var_dump(array_push($array, &$array));
-var_dump($array);
-
-echo "Done";
-?>
---EXPECTF--
-*** Testing array_push() : usage variations ***
-
--- Pass array_push referenced varialbes as $var arguments --
-int(9)
-array(9) {
-  [0]=>
-  int(1)
-  [1]=>
-  int(2)
-  [2]=>
-  int(3)
-  [3]=>
-  &string(1) "a"
-  [4]=>
-  &string(1) "b"
-  [5]=>
-  &string(1) "c"
-  [6]=>
-  &string(1) "x"
-  [7]=>
-  &string(1) "y"
-  [8]=>
-  &string(1) "z"
-}
-
--- Pass $var argument which is a reference to $stack argument --
-int(10)
-array(10) {
-  [0]=>
-  int(1)
-  [1]=>
-  int(2)
-  [2]=>
-  int(3)
-  [3]=>
-  &string(1) "a"
-  [4]=>
-  &string(1) "b"
-  [5]=>
-  &string(1) "c"
-  [6]=>
-  &string(1) "x"
-  [7]=>
-  &string(1) "y"
-  [8]=>
-  &string(1) "z"
-  [9]=>
-  &array(10) {
-    [0]=>
-    int(1)
-    [1]=>
-    int(2)
-    [2]=>
-    int(3)
-    [3]=>
-    &string(1) "a"
-    [4]=>
-    &string(1) "b"
-    [5]=>
-    &string(1) "c"
-    [6]=>
-    &string(1) "x"
-    [7]=>
-    &string(1) "y"
-    [8]=>
-    &string(1) "z"
-    [9]=>
-    *RECURSION*
-  }
-}
-Done

Modified: php/php-src/trunk/ext/standard/tests/array/array_slice_variation9.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/array_slice_variation9.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/array_slice_variation9.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test array_slice() function : usage variations - referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
@@ -29,12 +27,6 @@
 $val2 = 'hello, world';
 var_dump(array_slice($input, 1, 2, true));

-echo "\n-- Pass array by reference --\n";
-$new_input = array (1, 2, 3);
-var_dump(array_slice(&$new_input, 1));
-echo "-- Check passed array: --\n";
-var_dump($new_input);
-
 echo "Done";
 ?>

@@ -55,21 +47,4 @@
   [1]=>
   &string(5) "three"
 }
-
--- Pass array by reference --
-array(2) {
-  [0]=>
-  int(2)
-  [1]=>
-  int(3)
-}
--- Check passed array: --
-array(3) {
-  [0]=>
-  int(1)
-  [1]=>
-  int(2)
-  [2]=>
-  int(3)
-}
 Done

Modified: php/php-src/trunk/ext/standard/tests/array/array_values_variation6.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/array_values_variation6.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/array_values_variation6.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test array_values() function : usage variations - Referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : array array_values(array $input)
@@ -29,10 +27,6 @@
 $val2 = 'deux';
 var_dump($result1);

-echo "\n-- Pass \$input argument by reference --\n";
-$array = array(1, 2, 3);
-var_dump($result2 = array_values(&$array));
-
 echo "Done";
 ?>

@@ -57,14 +51,4 @@
   [2]=>
   &string(5) "three"
 }
-
--- Pass $input argument by reference --
-array(3) {
-  [0]=>
-  int(1)
-  [1]=>
-  int(2)
-  [2]=>
-  int(3)
-}
 Done

Modified: php/php-src/trunk/ext/standard/tests/array/bug33940.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/bug33940.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/bug33940.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,63 +0,0 @@
---TEST--
-Bug #33940 (array_map() fails to pass by reference when called recursively)
---INI--
-allow_call_time_pass_reference=1
-error_reporting=4095
---FILE--
-<?php
-function ref_map(&$item) {
-    if(!is_array($item)) {
-        $item = 1;
-        return 2;
-    } else {
-        $ret = array_map('ref_map', &$item);
-        return $ret;
-    }
-}
-
-$a = array(array(0), 0);
-$ret = array_map('ref_map', $a);
-echo 'Array: '; print_r($a);
-echo 'Return: '; print_r($ret);
-$a = array(array(0), 0);
-$ret = array_map('ref_map', &$a);
-echo 'Array: '; print_r($a);
-echo 'Return: '; print_r($ret);
-?>
---EXPECTF--
-Array: Array
-(
-    [0] => Array
-        (
-            [0] => 0
-        )
-
-    [1] => 0
-)
-Return: Array
-(
-    [0] => Array
-        (
-            [0] => 2
-        )
-
-    [1] => 2
-)
-Array: Array
-(
-    [0] => Array
-        (
-            [0] => 1
-        )
-
-    [1] => 1
-)
-Return: Array
-(
-    [0] => Array
-        (
-            [0] => 2
-        )
-
-    [1] => 2
-)

Modified: php/php-src/trunk/ext/standard/tests/array/each_variation4.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/each_variation4.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/each_variation4.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test each() function : usage variations - Referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : array each(array $arr)
@@ -29,14 +27,6 @@
 var_dump( each($arr1) );
 var_dump( each($arr1) );

-
-echo "\n-- Pass an array by reference to each(): --\n";
-$arr2 = array('zero', 'one', 'two');
-
-var_dump( each(&$arr2) );
-echo "-- Check original array: --\n";
-var_dump($arr2);
-
 echo "Done";
 ?>

@@ -66,25 +56,4 @@
   int(0)
 }
 bool(false)
-
--- Pass an array by reference to each(): --
-array(4) {
-  [1]=>
-  string(4) "zero"
-  ["value"]=>
-  string(4) "zero"
-  [0]=>
-  int(0)
-  ["key"]=>
-  int(0)
-}
--- Check original array: --
-array(3) {
-  [0]=>
-  string(4) "zero"
-  [1]=>
-  string(3) "one"
-  [2]=>
-  string(3) "two"
-}
 Done

Modified: php/php-src/trunk/ext/standard/tests/array/rsort_variation4.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/array/rsort_variation4.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/array/rsort_variation4.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test rsort() function : usage variations - referenced variables
---INI--
-allow_call_time_pass_reference=on
 --FILE--
 <?php
 /* Prototype  : bool rsort(array &$array_arg [, int $sort_flags])
@@ -35,11 +33,6 @@
 var_dump( rsort($temp_array, SORT_REGULAR) );
 var_dump( $temp_array);

-echo "\n-- 'flag' = SORT_NUMERIC --\n";
-$temp_array = $unsorted_numerics;
-var_dump( rsort(&$temp_array, SORT_NUMERIC) );
-var_dump( $temp_array);
-
 echo "Done";
 ?>
 --EXPECTF--
@@ -66,15 +59,4 @@
   [2]=>
   &int(33)
 }
-
--- 'flag' = SORT_NUMERIC --
-bool(true)
-array(3) {
-  [0]=>
-  &int(555)
-  [1]=>
-  &int(100)
-  [2]=>
-  &int(33)
-}
 Done

Modified: php/php-src/trunk/ext/standard/tests/general_functions/debug_zval_dump_v.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/debug_zval_dump_v.phpt	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/ext/standard/tests/general_functions/debug_zval_dump_v.phpt	2010-04-26 00:13:34 UTC (rev 298567)
@@ -1,7 +1,5 @@
 --TEST--
 Test debug_zval_dump() function : usage variations
---INI--
-allow_call_time_pass_reference=1
 --FILE--
 <?php
 /* Prototype: void debug_zval_dump ( mixed $variable );
@@ -115,7 +113,6 @@
 foreach( $misc_values as $value ) {
   echo "-- Iteration $counter --\n";
   debug_zval_dump( $value );
-  debug_zval_dump( &$value );
   $counter++;
 }

@@ -190,26 +187,18 @@
 *** Testing debug_zval_dump() on miscelleneous input arguments ***
 -- Iteration 1 --
 NULL refcount(3)
-&NULL refcount(2)
 -- Iteration 2 --
 NULL refcount(3)
-&NULL refcount(2)
 -- Iteration 3 --
 NULL refcount(1)
-&NULL refcount(2)
 -- Iteration 4 --
 NULL refcount(1)
-&NULL refcount(2)
 -- Iteration 5 --
 string(7) "TRUE123" refcount(3)
-&string(7) "TRUE123" refcount(2)
 -- Iteration 6 --
 string(9) "123string" refcount(3)
-&string(9) "123string" refcount(2)
 -- Iteration 7 --
 string(9) "string123" refcount(3)
-&string(9) "string123" refcount(2)
 -- Iteration 8 --
 string(10) "NULLstring" refcount(3)
-&string(10) "NULLstring" refcount(2)
 Done

Modified: php/php-src/trunk/main/main.c
===================================================================
--- php/php-src/trunk/main/main.c	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/main/main.c	2010-04-26 00:13:34 UTC (rev 298567)
@@ -432,7 +432,6 @@
 	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_ENTRY_EX("display_errors",		"1",		PHP_INI_ALL,		OnUpdateDisplayErrors,	display_errors,			php_core_globals,	core_globals, display_errors_mode)
 	STD_PHP_INI_BOOLEAN("display_startup_errors",	"0",	PHP_INI_ALL,		OnUpdateBool,			display_startup_errors,	php_core_globals,	core_globals)
@@ -2066,7 +2065,7 @@
 		struct {
 			const long error_level;
 			const char *phrase;
-			const char *directives[6]; /* Remember to change this if the number of directives change */
+			const char *directives[7]; /* Remember to change this if the number of directives change */
 		} directives[] = {
 			{
 				E_CORE_WARNING,
@@ -2088,6 +2087,7 @@
 					"register_globals",
 					"register_long_arrays",
 					"zend.ze1_compatibility_mode",
+					"allow_call_time_pass_reference",
 					NULL
 				}
 			}

Modified: php/php-src/trunk/main/php_globals.h
===================================================================
--- php/php-src/trunk/main/php_globals.h	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/main/php_globals.h	2010-04-26 00:13:34 UTC (rev 298567)
@@ -60,7 +60,6 @@

 	zend_bool safe_mode;

-	zend_bool allow_call_time_pass_reference;
 	zend_bool implicit_flush;

 	long output_buffering;

Modified: php/php-src/trunk/php.ini-development
===================================================================
--- php/php-src/trunk/php.ini-development	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/php.ini-development	2010-04-26 00:13:34 UTC (rev 298567)
@@ -91,11 +91,6 @@
 ; Please see the actual settings later in the document for more details as to why
 ; we recommend these changes in PHP's behavior.

-; allow_call_time_pass_reference
-;   Default Value: On
-;   Development Value: Off
-;   Production Value: Off
-
 ; display_errors
 ;   Default Value: On
 ;   Development Value: On
@@ -310,20 +305,6 @@
 ; are decoded with unserialize, the data will remain the same.
 serialize_precision = 100

-; This directive allows you to enable and disable warnings which PHP will issue
-; if you pass a value by reference at function call time. Passing values by
-; reference at function call time is a deprecated feature which will be removed
-; from PHP at some point in the near future. The acceptable method for passing a
-; value by reference to a function is by declaring the reference in the functions
-; definition, not at call time. This directive does not disable this feature, it
-; only determines whether PHP will warn you about it or not. These warnings
-; should enabled in development environments only.
-; Default Value: On (Suppress warnings)
-; Development Value: Off (Issue warnings)
-; Production Value: Off (Issue warnings)
-; http://php.net/allow-call-time-pass-reference
-allow_call_time_pass_reference = Off
-
 ; Safe Mode
 ; http://php.net/safe-mode
 safe_mode = Off

Modified: php/php-src/trunk/php.ini-production
===================================================================
--- php/php-src/trunk/php.ini-production	2010-04-26 00:01:25 UTC (rev 298566)
+++ php/php-src/trunk/php.ini-production	2010-04-26 00:13:34 UTC (rev 298567)
@@ -91,11 +91,6 @@
 ; Please see the actual settings later in the document for more details as to why
 ; we recommend these changes in PHP's behavior.

-; allow_call_time_pass_reference
-;   Default Value: On
-;   Development Value: Off
-;   Production Value: Off
-
 ; display_errors
 ;   Default Value: On
 ;   Development Value: On
@@ -310,20 +305,6 @@
 ; are decoded with unserialize, the data will remain the same.
 serialize_precision = 100

-; This directive allows you to enable and disable warnings which PHP will issue
-; if you pass a value by reference at function call time. Passing values by
-; reference at function call time is a deprecated feature which will be removed
-; from PHP at some point in the near future. The acceptable method for passing a
-; value by reference to a function is by declaring the reference in the functions
-; definition, not at call time. This directive does not disable this feature, it
-; only determines whether PHP will warn you about it or not. These warnings
-; should enabled in development environments only.
-; Default Value: On (Suppress warnings)
-; Development Value: Off (Issue warnings)
-; Production Value: Off (Issue warnings)
-; http://php.net/allow-call-time-pass-reference
-allow_call_time_pass_reference = Off
-
 ; Safe Mode
 ; http://php.net/safe-mode
 safe_mode = Off
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to