summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-02-02 23:07:25 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-02-03 21:02:52 +0100
commit06a034016280435feb80eea4d674ca5688ab4c06 (patch)
treeb9860ce0cacadef78cf3ed1fc250f3048aee4793 /tests
parent6ba720662084306906e125d8f690146d7b86b303 (diff)
downloadphp-git-06a034016280435feb80eea4d674ca5688ab4c06.tar.gz
Deprecate each()
Diffstat (limited to 'tests')
-rw-r--r--tests/classes/iterators_006.phpt7
-rw-r--r--tests/lang/031.phpt4
-rw-r--r--tests/lang/each_binary_safety.phpt4
3 files changed, 9 insertions, 6 deletions
diff --git a/tests/classes/iterators_006.phpt b/tests/classes/iterators_006.phpt
index 8017a8a360..564f15de54 100644
--- a/tests/classes/iterators_006.phpt
+++ b/tests/classes/iterators_006.phpt
@@ -29,10 +29,9 @@ class ai implements Iterator {
}
function next() {
- list($this->key, $this->current) = each($this->array);
-// list($key, $current) = each($this->array);
-// $this->key = $key;
-// $this->current = $current;
+ $this->key = key($this->array);
+ $this->current = current($this->array);
+ next($this->array);
}
}
diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt
index b2d1e631ec..134df03684 100644
--- a/tests/lang/031.phpt
+++ b/tests/lang/031.phpt
@@ -49,8 +49,10 @@ while(list(,$o) = each($arrayOuter)){
reset($arrayOuter);
reset($arrayInner);
?>
---EXPECT--
+--EXPECTF--
Correct - with inner loop reset.
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
inloop 0 for key1
inloop 1 for key1
inloop 0 for key2
diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt
index bb13534546..37b18b32c7 100644
--- a/tests/lang/each_binary_safety.phpt
+++ b/tests/lang/each_binary_safety.phpt
@@ -9,5 +9,7 @@ while (list($key, $val) = each($arr)) {
echo urlencode($key), ' => ', urlencode($val), "\n";
}
?>
---EXPECT--
+--EXPECTF--
+
+Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d
7: foo%00bar => foo%00bar