summaryrefslogtreecommitdiff
path: root/ext/standard/tests
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2019-08-21 02:27:27 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-02 10:38:23 +0200
commit1ca4ab09a584b5e3c7caf4466fbb435991c7000b (patch)
treef598144f4587c67417bee316f9662d4e3982db8d /ext/standard/tests
parent2f92957fd3d8d87e73013c016e479451db0c6a1e (diff)
downloadphp-git-1ca4ab09a584b5e3c7caf4466fbb435991c7000b.tar.gz
Promote warnings to errors in array_push()
This is in line with the engine change from https://wiki.php.net/rfc/engine_warnings.
Diffstat (limited to 'ext/standard/tests')
-rw-r--r--ext/standard/tests/array/array_push_error2.phpt11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/standard/tests/array/array_push_error2.phpt b/ext/standard/tests/array/array_push_error2.phpt
index 3ab60136be..2d19dbc246 100644
--- a/ext/standard/tests/array/array_push_error2.phpt
+++ b/ext/standard/tests/array/array_push_error2.phpt
@@ -15,17 +15,18 @@ Test array_push() function : error conditions - max int value as key
echo "*** Testing array_push() : error conditions ***\n";
$array = array(PHP_INT_MAX => 'max');
-
-var_dump(array_push($array, 'new'));
+try {
+ var_dump(array_push($array, 'new'));
+} catch (\Error $e) {
+ echo $e->getMessage() . "\n";
+}
var_dump($array);
echo "Done";
?>
--EXPECTF--
*** Testing array_push() : error conditions ***
-
-Warning: array_push(): Cannot add element to the array as the next element is already occupied in %s on line %d
-bool(false)
+Cannot add element to the array as the next element is already occupied
array(1) {
[%d]=>
string(3) "max"