mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
- added warning about misuse of gettype
- added some see-also's git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@47888 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8f7d40ee34
commit
efd4406a3b
1 changed files with 28 additions and 3 deletions
|
@ -113,6 +113,17 @@ if (!isset($var)) { // evaluates false
|
|||
Returns the type of the PHP variable
|
||||
<parameter>var</parameter>.
|
||||
</para>
|
||||
<warning>
|
||||
<simpara>
|
||||
Never use <function>gettype</function> to test for a certain type,
|
||||
since the returned string may be subject to change in a future version.
|
||||
In addition, it is slow too, as it involves string comparision <!--
|
||||
where's my dictionary? -->.
|
||||
</simpara>
|
||||
<simpara>
|
||||
Instead, use the <literal>is_*</literal> functions.
|
||||
</simpara>
|
||||
</warning>
|
||||
<para>
|
||||
Possibles values for the returned string are:
|
||||
<itemizedlist>
|
||||
|
@ -154,7 +165,18 @@ if (!isset($var)) { // evaluates false
|
|||
<function>gettype</function> on a function.
|
||||
</para>
|
||||
<para>
|
||||
See also <function>settype</function>.
|
||||
See also
|
||||
<function>settype</function>,
|
||||
<function>is_array</function>,
|
||||
<function>is_bool</function>,
|
||||
<function>is_double</function>,
|
||||
<function>is_integer</function>,
|
||||
<function>is_null</function>,
|
||||
<function>is_numeric</function>,
|
||||
<function>is_object</function>,
|
||||
<function>is_resource</function>,
|
||||
<function>is_scalar</function> and
|
||||
<function>is_string</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -958,7 +980,8 @@ if (!odbc_execute ($stmt, &$sqldata)) {
|
|||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Returns true if successful; otherwise returns false.
|
||||
Returns <literal>TRUE</literal> if successful; otherwise returns
|
||||
<literal>FALSE</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
|
@ -973,7 +996,9 @@ settype($bar, "string"); // $bar is now "1" (string)
|
|||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>gettype</function>.
|
||||
See also <function>gettype</function>,
|
||||
<link linkend="language.types.typecasting">type-casting</link> and
|
||||
<link linkend="language.types.type-juggling">type-juggling</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue