summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-05-25 19:28:15 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-26 19:06:19 +0200
commitfbe30592d6bec94463c68b27eabffca3a50c474e (patch)
tree5f7e2ca5bb754504eb0e4f7a49609088832172aa /tests
parent38c85efe83004d98b7cce89689b40de32f8b8add (diff)
downloadphp-git-fbe30592d6bec94463c68b27eabffca3a50c474e.tar.gz
Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object". Additionally, make the format of return type errors match the format of argument errors. Closes GH-5625
Diffstat (limited to 'tests')
-rw-r--r--tests/classes/tostring_001.phpt2
-rw-r--r--tests/classes/tostring_004.phpt6
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt
index 62791bf84e..abf41f97cd 100644
--- a/tests/classes/tostring_001.phpt
+++ b/tests/classes/tostring_001.phpt
@@ -131,5 +131,5 @@ Converted
object(test3)#2 (0) {
}
test3::__toString()
-Return value of test3::__toString() must be of type string, array returned
+test3::__toString(): Return value must be of type string, array returned
====DONE====
diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt
index e07a7b2121..48ac2770dd 100644
--- a/tests/classes/tostring_004.phpt
+++ b/tests/classes/tostring_004.phpt
@@ -53,7 +53,7 @@ try {
--EXPECT--
Object with no __toString():
Try 1:
-printf(): Argument #1 ($format) must be of type string, object given
+printf(): Argument #1 ($format) must be of type string, stdClass given
Try 2:
@@ -62,8 +62,8 @@ Object of class stdClass could not be converted to string
Object with bad __toString():
Try 1:
-Return value of badToString::__toString() must be of type string, array returned
+badToString::__toString(): Return value must be of type string, array returned
Try 2:
-Return value of badToString::__toString() must be of type string, array returned
+badToString::__toString(): Return value must be of type string, array returned