From fef879a2d63899ed25f39b4581c16682afdd0a8f Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sun, 4 Feb 2018 16:42:36 -0200 Subject: Use bool instead of boolean while throwing a type error PHP requires boolean typehints to be written "bool" and disallows "boolean" as an alias. This changes the error messages to match the actual type name and avoids confusing messages like "must be of type boolean, boolean given". This a followup to ce1d69a1f6dcf15d43029301059c25e5bc09a577, which implements the same change for integer->int. --- Zend/tests/type_declarations/scalar_return_basic.phpt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Zend/tests/type_declarations/scalar_return_basic.phpt') diff --git a/Zend/tests/type_declarations/scalar_return_basic.phpt b/Zend/tests/type_declarations/scalar_return_basic.phpt index cf58f91500..dd7a3daf85 100644 --- a/Zend/tests/type_declarations/scalar_return_basic.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic.phpt @@ -200,17 +200,17 @@ bool(true) *** Trying bool(false) bool(false) *** Trying NULL -*** Caught Return value of {closure}() must be of the type boolean, null returned in %s on line %d +*** Caught Return value of {closure}() must be of the type bool, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of the type boolean, array returned in %s on line %d +*** Caught Return value of {closure}() must be of the type bool, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of the type boolean, object returned in %s on line %d +*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d *** Trying object(Stringable)#7 (0) { } -*** Caught Return value of {closure}() must be of the type boolean, object returned in %s on line %d +*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of the type boolean, resource returned in %s on line %d +*** Caught Return value of {closure}() must be of the type bool, resource returned in %s on line %d Done -- cgit v1.2.1