mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Clarify behavior of wrong return types in weak mode
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350301 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c6a8e42bdb
commit
65acc18cd9
1 changed files with 4 additions and 1 deletions
|
@ -1040,7 +1040,10 @@ $newref =& returns_reference();
|
|||
<link linkend="functions.arguments.type-declaration.strict">Strict typing</link>
|
||||
also has an effect on return type declarations. In the default weak mode,
|
||||
returned values will be coerced to the correct type if they are not
|
||||
already of that type. In strong mode, the returned value must be of the
|
||||
already of that type. If this type conversion is not allowed
|
||||
(e.g. when returning an &array; from a function with return type &integer;),
|
||||
a <classname>TypeError</classname> will be thrown.
|
||||
In strict mode, the returned value must be of the
|
||||
correct type, otherwise a <classname>TypeError</classname> will be thrown.
|
||||
</para>
|
||||
|
||||
|
|
Loading…
Reference in a new issue