File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
general_functions /
bug29038.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings)
--FILE--
<?php
function f1() {
$c = extract(array("" => 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
)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>