diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-26 16:45:54 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-27 13:00:07 +0200 |
| commit | 0ebf2bdba0eb6510d7d397d1d826cfe7f9525ad1 (patch) | |
| tree | f5d9654816d30ea31695f713d7cf86f636eebe23 /tests | |
| parent | f2b09969db675adf7fa767378deb894c9bf029e0 (diff) | |
| download | php-git-0ebf2bdba0eb6510d7d397d1d826cfe7f9525ad1.tar.gz | |
Convert "Illegal offset type" warnings to exceptions
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/classes/tostring_001.phpt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt index 418aa1fc25..ba2bc3eb53 100644 --- a/tests/classes/tostring_001.phpt +++ b/tests/classes/tostring_001.phpt @@ -56,7 +56,11 @@ echo $o , $o; echo "====test7====\n"; $ar = array(); $ar[$o->__toString()] = "ERROR"; -echo $ar[$o]; +try { + echo $ar[$o]; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} echo "====test8====\n"; var_dump(trim($o)); @@ -76,7 +80,7 @@ try { ?> ====DONE==== ---EXPECTF-- +--EXPECT-- ====test1==== test1 Object ( @@ -114,8 +118,7 @@ test2::__toString() Converted ====test7==== test2::__toString() - -Warning: Illegal offset type in %s on line %d +Illegal offset type ====test8==== test2::__toString() string(9) "Converted" @@ -125,7 +128,7 @@ string(9) "Converted" test2::__toString() Converted ====test10==== -object(test3)#1 (0) { +object(test3)#2 (0) { } test3::__toString() Method test3::__toString() must return a string value |
