summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/mysqli/tests/bug42378.phpt25
-rw-r--r--ext/mysqli/tests/mysqli_explain_metadata.phpt3
-rw-r--r--ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt22
-rw-r--r--ext/pcre/tests/bug44191.phpt4
-rw-r--r--ext/standard/tests/array/each.phptbin9574 -> 9688 bytes
-rw-r--r--ext/standard/tests/array/each_basic.phpt4
-rw-r--r--ext/standard/tests/array/each_variation1.phpt2
-rw-r--r--ext/standard/tests/array/each_variation2.phpt4
-rw-r--r--ext/standard/tests/array/each_variation3.phpt4
-rw-r--r--ext/standard/tests/array/each_variation4.phpt2
-rw-r--r--ext/standard/tests/array/each_variation5.phpt4
-rw-r--r--ext/standard/tests/array/each_variation6.phpt4
-rw-r--r--ext/xml/tests/xml001.phpt2
-rw-r--r--ext/xml/tests/xml002.phpt2
-rw-r--r--ext/xml/tests/xml003.phpt2
-rw-r--r--ext/xml/tests/xml004.phpt2
-rw-r--r--ext/xml/tests/xml_closures_001.phpt2
17 files changed, 53 insertions, 35 deletions
diff --git a/ext/mysqli/tests/bug42378.phpt b/ext/mysqli/tests/bug42378.phpt
index b3fd7ca524..f3bbe346fa 100644
--- a/ext/mysqli/tests/bug42378.phpt
+++ b/ext/mysqli/tests/bug42378.phpt
@@ -128,19 +128,18 @@ memory_limit=83886080
}
}
- if (!empty($expected))
- reset($expected);
- while ((list($k, $v) = each($expected)) && mysqli_stmt_fetch($stmt)) {
- if (!empty($expected)) {
- if ($result !== $v) {
- printf("[%03d] Row %d - expecting %s/%s got %s/%s [%s] with %s - %s.\n",
- $offset + 8,
- $k,
- gettype($v), $v,
- gettype($result), $result,
- $order_by_col,
- $format, $sql);
- }
+ foreach ($expected as $k => $v) {
+ if (!mysqli_stmt_fetch($stmt)) {
+ break;
+ }
+ if ($result !== $v) {
+ printf("[%03d] Row %d - expecting %s/%s got %s/%s [%s] with %s - %s.\n",
+ $offset + 8,
+ $k,
+ gettype($v), $v,
+ gettype($result), $result,
+ $order_by_col,
+ $format, $sql);
}
}
diff --git a/ext/mysqli/tests/mysqli_explain_metadata.phpt b/ext/mysqli/tests/mysqli_explain_metadata.phpt
index fc1f9dbe49..8f4a7cc8c5 100644
--- a/ext/mysqli/tests/mysqli_explain_metadata.phpt
+++ b/ext/mysqli/tests/mysqli_explain_metadata.phpt
@@ -130,7 +130,8 @@ if (!$IS_MYSQLND)
}
reset($fields);
foreach ($fields_stmt as $fields_stmt_val) {
- list(,$fields_val) = each($fields);
+ $fields_val = current($fields);
+ next($fields);
unset($fields_stmt_val->max_length);
unset($fields_val->max_length);
if ($fields_stmt_val != $fields_val) {
diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt
index dee5a7e0f0..68ec601e10 100644
--- a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt
+++ b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt
@@ -117,8 +117,10 @@ memory_limit=83886080
return false;
}
- reset($expected);
- while ((list($k, $v) = each($expected)) && mysqli_stmt_fetch($stmt)) {
+ foreach ($expected as $k => $v) {
+ if (!mysqli_stmt_fetch($stmt)) {
+ break;
+ }
if ($result !== $v) {
printf("[%03d] Row %d - expecting %s/%s got %s/%s [%s] with %s - %s.\n",
$offset + 8,
@@ -269,9 +271,10 @@ memory_limit=83886080
break;
}
- reset($values);
- while (mysqli_stmt_fetch($stmt)) {
- list($exp_trend, $exp_targetport) = each($values);
+ foreach ($values as $exp_trend => $exp_targetport) {
+ if (!mysqli_stmt_fetch($stmt)) {
+ break;
+ }
if ($targetport != $exp_targetport) {
printf("[306] Values fetched from MySQL seem to be wrong, check manually\n");
printf("%s/%s - %s/%s - '%s'\n", $trend, $exp_trend, $targetport, $exp_targetport, $format);
@@ -308,9 +311,10 @@ memory_limit=83886080
break;
}
- reset($values);
- while ($stmt->fetch()) {
- list($exp_trend, $exp_targetport) = each($values);
+ foreach ($values as $exp_trend => $exp_targetport) {
+ if (!$stmt->fetch()) {
+ break;
+ }
if ($targetport != $exp_targetport) {
printf("[312] Values fetched from MySQL seem to be wrong, check manually\n");
printf("%s/%s - %s/%s - '%s'\n", $trend, $exp_trend, $targetport, $exp_targetport, $format);
@@ -334,4 +338,4 @@ memory_limit=83886080
require_once("clean_table.inc");
?>
--EXPECTF--
-done! \ No newline at end of file
+done!
diff --git a/ext/pcre/tests/bug44191.phpt b/ext/pcre/tests/bug44191.phpt
index 52b449091b..73fc29cd90 100644
--- a/ext/pcre/tests/bug44191.phpt
+++ b/ext/pcre/tests/bug44191.phpt
@@ -7,8 +7,8 @@ $array = range(1, 10);
preg_grep('/asdf/', $array);
-while (list($x) = each($array)) {
- print $x;
+foreach ($array as $k => $v) {
+ print $k;
}
?>
diff --git a/ext/standard/tests/array/each.phpt b/ext/standard/tests/array/each.phpt
index 974808c08c..f1b6f76ea6 100644
--- a/ext/standard/tests/array/each.phpt
+++ b/ext/standard/tests/array/each.phpt
Binary files differ
diff --git a/ext/standard/tests/array/each_basic.phpt b/ext/standard/tests/array/each_basic.phpt
index 350b40f9a3..b12b4c19f7 100644
--- a/ext/standard/tests/array/each_basic.phpt
+++ b/ext/standard/tests/array/each_basic.phpt
@@ -46,6 +46,8 @@ array(4) {
}
-- Initial position: --
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
array(4) {
[1]=>
int(1)
@@ -71,4 +73,4 @@ array(4) {
-- Passed the end of array: --
bool(false)
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/array/each_variation1.phpt b/ext/standard/tests/array/each_variation1.phpt
index 0afef31432..becdfc4545 100644
--- a/ext/standard/tests/array/each_variation1.phpt
+++ b/ext/standard/tests/array/each_variation1.phpt
@@ -101,6 +101,8 @@ echo "Done";
-- Iteration 1 --
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
+
Warning: Variable passed to each() is not an array or object in %s on line %d
NULL
diff --git a/ext/standard/tests/array/each_variation2.phpt b/ext/standard/tests/array/each_variation2.phpt
index 3f7211c89c..73b1ba2746 100644
--- a/ext/standard/tests/array/each_variation2.phpt
+++ b/ext/standard/tests/array/each_variation2.phpt
@@ -122,6 +122,8 @@ echo "Done";
*** Testing each() : usage variations ***
-- Iteration 1: int data --
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
array(4) {
[1]=>
int(0)
@@ -245,4 +247,4 @@ array(4) {
["key"]=>
int(0)
}
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/array/each_variation3.phpt b/ext/standard/tests/array/each_variation3.phpt
index b31ddc61b4..375615643f 100644
--- a/ext/standard/tests/array/each_variation3.phpt
+++ b/ext/standard/tests/array/each_variation3.phpt
@@ -108,6 +108,8 @@ echo "Done";
*** Testing each() : usage variations ***
-- Iteration 1: int data --
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
array(4) {
[1]=>
string(4) "zero"
@@ -250,4 +252,4 @@ array(4) {
["key"]=>
string(0) ""
}
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/array/each_variation4.phpt b/ext/standard/tests/array/each_variation4.phpt
index 535ae297d1..14b5536135 100644
--- a/ext/standard/tests/array/each_variation4.phpt
+++ b/ext/standard/tests/array/each_variation4.phpt
@@ -35,6 +35,8 @@ echo "Done";
-- Array made up of referenced variables: --
-- Call each until at the end of the array: --
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
array(4) {
[1]=>
string(3) "foo"
diff --git a/ext/standard/tests/array/each_variation5.phpt b/ext/standard/tests/array/each_variation5.phpt
index 941ad5e3ac..b6c39538a3 100644
--- a/ext/standard/tests/array/each_variation5.phpt
+++ b/ext/standard/tests/array/each_variation5.phpt
@@ -37,6 +37,8 @@ echo "Done";
*** Testing each() : usage variations ***
-- Pass each() a two-dimensional array --
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
array(4) {
[1]=>
string(4) "zero"
@@ -93,4 +95,4 @@ array(4) {
["key"]=>
int(0)
}
-Done \ No newline at end of file
+Done
diff --git a/ext/standard/tests/array/each_variation6.phpt b/ext/standard/tests/array/each_variation6.phpt
index 445d63f318..ba0f2657c8 100644
--- a/ext/standard/tests/array/each_variation6.phpt
+++ b/ext/standard/tests/array/each_variation6.phpt
@@ -35,6 +35,8 @@ echo "Done";
0 => zero
-- Call to each(): --
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
array(4) {
[1]=>
string(4) "zero"
@@ -48,4 +50,4 @@ array(4) {
-- New position: --
1 => one
-Done \ No newline at end of file
+Done
diff --git a/ext/xml/tests/xml001.phpt b/ext/xml/tests/xml001.phpt
index 9c03b553cc..987991e8a8 100644
--- a/ext/xml/tests/xml001.phpt
+++ b/ext/xml/tests/xml001.phpt
@@ -35,7 +35,7 @@ function startElement($parser, $name, $attribs)
{
print '{'.$name;
if (sizeof($attribs)) {
- while (list($k, $v) = each($attribs)) {
+ foreach ($attribs as $k => $v) {
print " $k=\"$v\"";
}
}
diff --git a/ext/xml/tests/xml002.phpt b/ext/xml/tests/xml002.phpt
index ce547e8acc..f56319932e 100644
--- a/ext/xml/tests/xml002.phpt
+++ b/ext/xml/tests/xml002.phpt
@@ -15,7 +15,7 @@ class myclass
{
print '{'.$name;
if (sizeof($attribs)) {
- while (list($k, $v) = each($attribs)) {
+ foreach ($attribs as $k => $v) {
print " $k=\"$v\"";
}
}
diff --git a/ext/xml/tests/xml003.phpt b/ext/xml/tests/xml003.phpt
index 6b0c3f5c5a..973431104b 100644
--- a/ext/xml/tests/xml003.phpt
+++ b/ext/xml/tests/xml003.phpt
@@ -15,7 +15,7 @@ class myclass
{
print '{'.$name;
if (sizeof($attribs)) {
- while (list($k, $v) = each($attribs)) {
+ foreach ($attribs as $k => $v) {
print " $k=\"$v\"";
}
}
diff --git a/ext/xml/tests/xml004.phpt b/ext/xml/tests/xml004.phpt
index 245a93fc10..a9e68e103f 100644
--- a/ext/xml/tests/xml004.phpt
+++ b/ext/xml/tests/xml004.phpt
@@ -27,7 +27,7 @@ function start_element($xp, $elem, $attribs)
{
print "<$elem";
if (sizeof($attribs)) {
- while (list($k, $v) = each($attribs)) {
+ foreach ($attribs as $k => $v) {
print " $k=\"$v\"";
}
}
diff --git a/ext/xml/tests/xml_closures_001.phpt b/ext/xml/tests/xml_closures_001.phpt
index 37df254190..defffbb2ae 100644
--- a/ext/xml/tests/xml_closures_001.phpt
+++ b/ext/xml/tests/xml_closures_001.phpt
@@ -10,7 +10,7 @@ $start_element = function ($xp, $elem, $attribs)
{
print "<$elem";
if (sizeof($attribs)) {
- while (list($k, $v) = each($attribs)) {
+ foreach ($attribs as $k => $v) {
print " $k=\"$v\"";
}
}