diff options
author | Márcio Almada <marcio3w@gmail.com> | 2015-06-09 03:56:34 -0300 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-06-10 22:18:23 +0200 |
commit | fdda34e0bc13967be78bc04997d907d512ee8917 (patch) | |
tree | 7ba9e8c6ce9d7787b37529f426e4eda0440e9ec7 /Zend/tests/array_offset.phpt | |
parent | 51dbf73954ae00588b8219a12e32cf05166c039f (diff) | |
download | php-git-fdda34e0bc13967be78bc04997d907d512ee8917.tar.gz |
fix bad formatted "undefined offset" notice when key is negative
Diffstat (limited to 'Zend/tests/array_offset.phpt')
-rw-r--r-- | Zend/tests/array_offset.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/array_offset.phpt b/Zend/tests/array_offset.phpt new file mode 100644 index 0000000000..76c25f9298 --- /dev/null +++ b/Zend/tests/array_offset.phpt @@ -0,0 +1,21 @@ +--TEST-- +Ensure "undefined offset" notice formats message corectly when undefined key is negative +--FILE-- +<?php + +[][-1]; +[][-1.1]; +(new ArrayObject)[-1]; +(new ArrayObject)[-1.1]; + +echo "Done\n"; +?> +--EXPECTF-- +Notice: Undefined offset: -1 in %s on line 3 + +Notice: Undefined offset: -1 in %s on line 4 + +Notice: Undefined offset: -1 in %s on line 5 + +Notice: Undefined offset: -1 in %s on line 6 +Done |