From: SVN Migration Date: Sun, 11 Jul 2004 21:15:05 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. X-Git-Tag: php-4.3.9RC1~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fb6cde415be778431d8d67364d47eab29dde0d0;p=php This commit was manufactured by cvs2svn to create branch 'PHP_4_3'. --- diff --git a/ext/standard/tests/array/bug28974.phpt b/ext/standard/tests/array/bug28974.phpt new file mode 100644 index 0000000000..fb272e1d74 --- /dev/null +++ b/ext/standard/tests/array/bug28974.phpt @@ -0,0 +1,89 @@ +--TEST-- +Bug #28974 array_(p)slice() treats large lengths incorrectly - overflow +--FILE-- + +--EXPECT-- +Array +( + [0] => 0 + [1] => 1 + [2] => 2 + [3] => 3 + [4] => 4 + [5] => 5 +) +Array +( + [0] => 2 + [1] => 3 + [2] => 4 + [3] => 5 +) +Array +( + [0] => 2 + [1] => 3 + [2] => 4 + [3] => 5 +) +print_r(array_splice($a,2,1)); +Array +( + [0] => 2 +) +$a is :Array +( + [0] => 0 + [1] => 1 + [2] => 3 + [3] => 4 + [4] => 5 +) +print_r(array_splice($b,2,2147483645)); +Array +( + [0] => 2 + [1] => 3 + [2] => 4 + [3] => 5 +) +$b is :Array +( + [0] => 0 + [1] => 1 +) +print_r(array_splice($c,2,2147483646)); +Array +( + [0] => 2 + [1] => 3 + [2] => 4 + [3] => 5 +) +$c is :Array +( + [0] => 0 + [1] => 1 +) diff --git a/ext/standard/tests/general_functions/bug29038.phpt b/ext/standard/tests/general_functions/bug29038.phpt new file mode 100644 index 0000000000..8804ffbaa9 --- /dev/null +++ b/ext/standard/tests/general_functions/bug29038.phpt @@ -0,0 +1,74 @@ +--TEST-- +bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings) +--FILE-- + 1),EXTR_PREFIX_SAME,"prefix"); + echo "Extracted:"; + var_dump($c); + print_r(get_defined_vars()); +} +function f2() { + $a = 1; + $c = extract(array("a" => 1),EXTR_PREFIX_SAME,"prefix"); + echo "Extracted:"; + var_dump($c); + print_r(get_defined_vars()); +} +function f3() { + $a = 1; + $c = extract(array("a" => 1),EXTR_PREFIX_ALL,"prefix"); + echo "Extracted:"; + var_dump($c); + print_r(get_defined_vars()); +} +function f4() { + $c = extract(array("" => 1),EXTR_PREFIX_ALL,"prefix"); + echo "Extracted:"; + var_dump($c); + print_r(get_defined_vars()); +} +function f5() { + $c = extract(array("111" => 1),EXTR_PREFIX_ALL,"prefix"); + echo "Extracted:"; + var_dump($c); + print_r(get_defined_vars()); +} + +f1(); +f2(); +f3(); +f4(); +f5(); +?> +--EXPECT-- +Extracted:int(0) +Array +( + [c] => 0 +) +Extracted:int(1) +Array +( + [a] => 1 + [prefix_a] => 1 + [c] => 1 +) +Extracted:int(1) +Array +( + [a] => 1 + [prefix_a] => 1 + [c] => 1 +) +Extracted:int(0) +Array +( + [c] => 0 +) +Extracted:int(1) +Array +( + [prefix_111] => 1 + [c] => 1 +) \ No newline at end of file diff --git a/ext/standard/tests/serialize/bug28325.phpt b/ext/standard/tests/serialize/bug28325.phpt new file mode 100644 index 0000000000..7f2bd66371 --- /dev/null +++ b/ext/standard/tests/serialize/bug28325.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #28325 (Problem in serialisation of circular references) +--FILE-- +b = new b(); +$a->b->c = new c(); +$a->b->c->d = $a; +var_dump(unserialize(serialize($a))); +?> +--EXPECTF-- +object(a)#%d (1) { + ["b"]=> + object(b)#%d (1) { + ["c"]=> + object(c)#%d (1) { + ["d"]=> + object(a)#%d (1) { + ["b"]=> + object(b)#%d (1) { + ["c"]=> + object(c)#%d (1) { + ["d"]=> + *RECURSION* + } + } + } + } + } +}