sniper Thu Aug 11 19:50:07 2005 EDT
Modified files:
/php-src/ext/standard/tests/array bug33940.phpt
Log:
fix test
http://cvs.php.net/diff.php/php-src/ext/standard/tests/array/bug33940.phpt?r1=1.2&r2=1.3&ty=u
Index: php-src/ext/standard/tests/array/bug33940.phpt
diff -u php-src/ext/standard/tests/array/bug33940.phpt:1.2
php-src/ext/standard/tests/array/bug33940.phpt:1.3
--- php-src/ext/standard/tests/array/bug33940.phpt:1.2 Wed Aug 10 04:23:39 2005
+++ php-src/ext/standard/tests/array/bug33940.phpt Thu Aug 11 19:50:04 2005
@@ -1,62 +1,63 @@
---TEST--
-Bug #33940 array_map() fails to pass by reference when called recursively
---INI--
-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);
-?>
---EXPECT--
-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
-)
+--TEST--
+Bug #33940 array_map() fails to pass by reference when called recursively
+--INI--
+error_reporting=4095
+allow_call_time_pass_reference=1
+--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);
+?>
+--EXPECT--
+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
+)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php