diff options
author | Ondřej Surý <ondrej@sury.org> | 2010-10-21 08:52:46 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2010-10-21 08:52:46 +0200 |
commit | 01fcdff3849c3691d9aaeaab735846ab6d8895ca (patch) | |
tree | 6460876d356113fa7053df36f2aa00baa7db24a9 /ext/standard/tests/array | |
parent | 855a09f4eded707941180c9d90acd17c25e29447 (diff) | |
download | php-01fcdff3849c3691d9aaeaab735846ab6d8895ca.tar.gz |
Imported Upstream version 5.3.3upstream/5.3.3
Diffstat (limited to 'ext/standard/tests/array')
-rw-r--r-- | ext/standard/tests/array/array_map_variation2.phpt | 77 | ||||
-rw-r--r-- | ext/standard/tests/array/array_push_variation4.phpt | 23 | ||||
-rw-r--r-- | ext/standard/tests/array/array_values_variation4.phpt | 20 | ||||
-rw-r--r-- | ext/standard/tests/array/bug51552.phpt | 23 | ||||
-rw-r--r-- | ext/standard/tests/array/current_variation5.phpt | 58 | ||||
-rw-r--r-- | ext/standard/tests/array/natcasesort_variation7.phpt | 28 |
6 files changed, 94 insertions, 135 deletions
diff --git a/ext/standard/tests/array/array_map_variation2.phpt b/ext/standard/tests/array/array_map_variation2.phpt index e9608438f..16561abff 100644 --- a/ext/standard/tests/array/array_map_variation2.phpt +++ b/ext/standard/tests/array/array_map_variation2.phpt @@ -47,16 +47,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } } array(4) { @@ -94,16 +85,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } } } @@ -127,16 +109,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } } array(4) { @@ -166,16 +139,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } } } @@ -195,16 +159,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } } array(4) { @@ -240,16 +195,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } [1]=> &array(4) { @@ -260,16 +206,7 @@ array(4) { [0]=> &string(2) "v1" [1]=> - &array(4) { - ["k1"]=> - &string(2) "v1" - ["k2"]=> - string(2) "v2" - [0]=> - &string(2) "v1" - [1]=> - *RECURSION* - } + *RECURSION* } } } diff --git a/ext/standard/tests/array/array_push_variation4.phpt b/ext/standard/tests/array/array_push_variation4.phpt index ed339204f..f8f89042a 100644 --- a/ext/standard/tests/array/array_push_variation4.phpt +++ b/ext/standard/tests/array/array_push_variation4.phpt @@ -104,28 +104,7 @@ array(10) { [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* - } + *RECURSION* } } Done diff --git a/ext/standard/tests/array/array_values_variation4.phpt b/ext/standard/tests/array/array_values_variation4.phpt index 25980663e..9c35331fd 100644 --- a/ext/standard/tests/array/array_values_variation4.phpt +++ b/ext/standard/tests/array/array_values_variation4.phpt @@ -93,23 +93,7 @@ array(4) { int(3) } [0]=> - &array(4) { - ["zero"]=> - string(4) "zero" - ["un"]=> - string(3) "one" - ["sub"]=> - array(3) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - } - [0]=> - *RECURSION* - } + *RECURSION* } } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/bug51552.phpt b/ext/standard/tests/array/bug51552.phpt new file mode 100644 index 000000000..fb61f489b --- /dev/null +++ b/ext/standard/tests/array/bug51552.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #51552 (debug_backtrace() causes segmentation fault and/or memory issues) +--FILE-- +<?php +function walk($element, $key, $p) { + $backtrace = debug_backtrace(); + echo "$element\n"; +} + +$a = array(1,2,3,4,5,6,7,8,9,10); +array_walk($a, 'walk', 'testthis'); +?> +--EXPECT-- +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/ext/standard/tests/array/current_variation5.phpt b/ext/standard/tests/array/current_variation5.phpt new file mode 100644 index 000000000..b9bf4a995 --- /dev/null +++ b/ext/standard/tests/array/current_variation5.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test current() function : usage variations - reference +--FILE-- +<?php +/* Prototype : mixed current(array $array_arg) + * Description: Return the element currently pointed to by the internal array pointer + * Source code: ext/standard/array.c + * Alias to functions: pos + */ + +echo "*** Testing current() : usage variations ***\n"; + +echo "\n-- Function: reference parameter --\n"; + +function current_variation5_ref(&$a) +{ + var_dump(current($a)); + var_dump(next($a)); +} + +$a = array('yes', 'maybe', 'no'); + +var_dump(current($a)); +var_dump(next($a)); +current_variation5($a); + +echo "\n-- Function: normal parameter --\n"; + +function current_variation5($a) +{ + var_dump(current($a)); + var_dump(next($a)); +} + +$a = array('yes', 'maybe', 'no'); + +var_dump(current($a)); +var_dump(next($a)); +current_variation5($a); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +*** Testing current() : usage variations *** + +-- Function: reference parameter -- +string(3) "yes" +string(5) "maybe" +string(5) "maybe" +string(2) "no" + +-- Function: normal parameter -- +string(3) "yes" +string(5) "maybe" +string(5) "maybe" +string(2) "no" +===DONE=== diff --git a/ext/standard/tests/array/natcasesort_variation7.phpt b/ext/standard/tests/array/natcasesort_variation7.phpt index c038f7d1c..91be7e262 100644 --- a/ext/standard/tests/array/natcasesort_variation7.phpt +++ b/ext/standard/tests/array/natcasesort_variation7.phpt @@ -44,18 +44,7 @@ array(5) { [3]=> string(1) "2" [4]=> - &array(5) { - [0]=> - int(1) - [1]=> - float(3) - [2]=> - string(4) "zero" - [3]=> - string(1) "2" - [4]=> - *RECURSION* - } + *RECURSION* } } bool(true) @@ -75,22 +64,11 @@ array(5) { [1]=> float(3) [4]=> - &array(5) { - [0]=> - int(1) - [3]=> - string(1) "2" - [1]=> - float(3) - [4]=> - *RECURSION* - [2]=> - string(4) "zero" - } + *RECURSION* [2]=> string(4) "zero" } [2]=> string(4) "zero" } -Done
\ No newline at end of file +Done |