Skip to content

Commit cce5e8c

Browse files
author
Ilia Alshanetsky
committed
Updated tests to use [] instead of {}
1 parent 9aeb125 commit cce5e8c

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

ext/date/tests/date.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ $tmp = "cr";
66
putenv ("TZ=GMT0");
77

88
for($a = 0;$a < strlen($tmp); $a++){
9-
echo $tmp{$a}, ': ', date($tmp{$a}, 1043324459)."\n";
9+
echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n";
1010
}
1111

1212
putenv ("TZ=MET");
1313

1414
for($a = 0;$a < strlen($tmp); $a++){
15-
echo $tmp{$a}, ': ', date($tmp{$a}, 1043324459)."\n";
15+
echo $tmp[$a], ': ', date($tmp[$a], 1043324459)."\n";
1616
}
1717
?>
1818
--EXPECT--

ext/iconv/tests/iconv_substr.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ iconv.internal_charset=ISO-8859-1
99
function hexdump($str) {
1010
$len = strlen($str);
1111
for ($i = 0; $i < $len; ++$i) {
12-
printf("%02x", ord($str{$i}));
12+
printf("%02x", ord($str[$i]));
1313
}
1414
print "\n";
1515
}

ext/standard/tests/file/bug24482.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $globdirs = glob("*", GLOB_ONLYDIR);
1313
$dirs = array();
1414
$dh = opendir(".");
1515
while (is_string($file = readdir($dh))) {
16-
if ($file{0} === ".") continue;
16+
if ($file[0] === ".") continue;
1717
if (!is_dir($file)) continue;
1818
$dirs[] = $file;
1919
}

ext/standard/tests/time/idate.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ putenv ("TZ=GMT0");
66

77
$tmp = "UYzymndjHGhgistwLBIW";
88
for($a = 0;$a < strlen($tmp); $a++){
9-
echo $tmp{$a}, ': ', idate($tmp{$a}, 1043324459)."\n";
9+
echo $tmp[$a], ': ', idate($tmp[$a], 1043324459)."\n";
1010
}
1111
?>
1212
--EXPECT--

tests/lang/bug19943.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Bug #19943 (memleaks)
1212
echo $ar[$count]." -- ".$ar[$count]['idx']."\n";
1313
}
1414
$a = "0123456789";
15-
$a[9] = $a{0};
15+
$a[9] = $a[0];
1616
var_dump($a);
1717
?>
1818
--EXPECT--

tests/lang/bug22592.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ $s = "string";
1313

1414
$result = "* *-*";
1515
var_dump($result);
16-
$result{6} = '*';
16+
$result[6] = '*';
1717
var_dump($result);
18-
$result{1} = $i;
18+
$result[1] = $i;
1919
var_dump($result);
20-
$result{3} = $s;
20+
$result[3] = $s;
2121
var_dump($result);
22-
$result{7} = 0;
22+
$result[7] = 0;
2323
var_dump($result);
24-
$a = $result{1} = $result{3} = '-';
24+
$a = $result[1] = $result[3] = '-';
2525
var_dump($result);
26-
$b = $result{3} = $result{5} = $s;
26+
$b = $result[3] = $result[5] = $s;
2727
var_dump($result);
28-
$c = $result{0} = $result{2} = $result{4} = $i;
28+
$c = $result[0] = $result[2] = $result[4] = $i;
2929
var_dump($result);
30-
$d = $result{6} = $result{8} = 5;
30+
$d = $result[6] = $result[8] = 5;
3131
var_dump($result);
32-
$e = $result{1} = $result{6};
32+
$e = $result[1] = $result[6];
3333
var_dump($result);
3434
var_dump($a, $b, $c, $d, $e);
35-
$result{-1} = 'a';
35+
$result[-1] = 'a';
3636
?>
3737
--EXPECT--
3838
string(5) "* *-*"

tests/lang/bug26696.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Bug #26696 (string index in a switch() crashes with multiple matches)
66
$str = 'asdd/?';
77
$len = strlen($str);
88
for ($i = 0; $i < $len; $i++) {
9-
switch ($str{$i}) {
9+
switch ($str[$i]) {
1010
case '?':
1111
echo "OK\n";
1212
break;
1313
}
1414
}
1515

1616
$str = '*';
17-
switch ($str{0}) {
17+
switch ($str[0]) {
1818
case '*';
1919
echo "OK\n";
2020
break;

tests/strings/bug22592.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ $t = $x[] = 'x';
99
var_dump($correct);
1010
var_dump($wrong);
1111

12-
$correct{1} = '*';
13-
$correct{3} = '*';
14-
$correct{5} = '*';
12+
$correct[1] = '*';
13+
$correct[3] = '*';
14+
$correct[5] = '*';
1515

1616
// This produces the
17-
$wrong{1} = $wrong{3} = $wrong{5} = '*';
17+
$wrong[1] = $wrong[3] = $wrong[5] = '*';
1818

1919
var_dump($correct);
2020
var_dump($wrong);

0 commit comments

Comments
 (0)