summaryrefslogtreecommitdiff
path: root/Zend/tests/offset_string.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-09-26 16:45:54 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-09-27 13:00:07 +0200
commit0ebf2bdba0eb6510d7d397d1d826cfe7f9525ad1 (patch)
treef5d9654816d30ea31695f713d7cf86f636eebe23 /Zend/tests/offset_string.phpt
parentf2b09969db675adf7fa767378deb894c9bf029e0 (diff)
downloadphp-git-0ebf2bdba0eb6510d7d397d1d826cfe7f9525ad1.tar.gz
Convert "Illegal offset type" warnings to exceptions
Diffstat (limited to 'Zend/tests/offset_string.phpt')
-rw-r--r--Zend/tests/offset_string.phpt30
1 files changed, 18 insertions, 12 deletions
diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt
index 3ad48e7412..01b0815ea0 100644
--- a/Zend/tests/offset_string.phpt
+++ b/Zend/tests/offset_string.phpt
@@ -17,13 +17,25 @@ var_dump($str[TRUE]);
var_dump($str[FALSE]);
$fp = fopen(__FILE__, "r");
-var_dump($str[$fp]);
+try {
+ var_dump($str[$fp]);
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
$obj = new stdClass;
-var_dump($str[$obj]);
+try {
+ var_dump($str[$obj]);
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
$arr = Array(1,2,3);
-var_dump($str[$arr]);
+try {
+ var_dump($str[$arr]);
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
echo "Done\n";
?>
@@ -51,15 +63,9 @@ string(1) "i"
Notice: String offset cast occurred in %s on line %d
string(1) "S"
-
-Warning: Illegal offset type in %s on line %d
-string(1) "%s"
-
-Warning: Illegal offset type in %s on line %d
+Illegal offset type
Notice: Object of class stdClass could not be converted to int in %s on line %d
-string(1) "%s"
-
-Warning: Illegal offset type in %s on line %d
-string(1) "i"
+Illegal offset type
+Illegal offset type
Done