Re: svn: /phpdoc/en/trunk/language/predefined/ typeerror.xml
| From: | Nikita Popov | Date: | Mon, 12 Oct 2015 19:29:14 +0000 |
| Subject: | Re: svn: /phpdoc/en/trunk/language/predefined/ typeerror.xml | ||
| References: | 1 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-13786@lists.php.net to get a copy of this message | ||
On Mon, Oct 12, 2015 at 9:26 PM, Thomas Punt <tpunt@php.net> wrote:
> tpunt Mon, 12 Oct 2015 19:26:37 +0000
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=337987ý“õå™ä]6îÝ
> ·—Ö-L
>
> Log:
> Update TypeError description
>
> Changed paths:
> U phpdoc/en/trunk/language/predefined/typeerror.xml
>
> Modified: phpdoc/en/trunk/language/predefined/typeerror.xml
> ===================================================================
> --- phpdoc/en/trunk/language/predefined/typeerror.xml 2015-10-12
> 18:17:44 UTC (rev 337986)
> +++ phpdoc/en/trunk/language/predefined/typeerror.xml 2015-10-12
> 19:26:37 UTC (rev 337987)
> @@ -15,11 +15,14 @@
> <section xml:id="typeerror.intro">
> &reftitle.intro;
> <para>
> - <ooclass><classname>TypeError</classname></ooclass> is thrown when
> strict
> - typing is enabled and an invalid argument is given to a function.
> - <ooclass><classname>TypeError</classname></ooclass> is also thrown
> when an
> - invalid number of arguments are passed to a function.
> - </para>
> + There are three scenarios where a
> + <ooclass><classname>TypeError</classname></ooclass> may be thrown.
> The
> + first is where the argument type being passed to a function does not
> match
> + its corresponding declared parameter type (strict mode only). The
> second is
> + where a value being returned from a function does not match the
> declared
> + function return type (strict mode only, again). The third is where an
> + invalid number of arguments are passed to a built-in PHP function.
> + </para>
> </section>
> <!-- }}} -->
>
It's not strict mode only. It's strict mode only *for internal functions*.
For user functions a typehint failure will always result in TypeError.
Nikita