Added note to intval. var argument should be a string if used in conjunction with the optional base argument

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@50051 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Zak Greant 2001-06-23 17:26:18 +00:00
parent 4510c8c833
commit a466136fe7

View file

@ -58,16 +58,16 @@ print $double_value_of_var; // prints 122.34343
</para>
</note>
<para>
This is the opposite of
This is the opposite of
<literal>(boolean) <parameter>var</parameter></literal>,
except that no warning is generated when the variable is not set.
See <link linkend="language.types.boolean.casting">converting
See <link linkend="language.types.boolean.casting">converting
to boolean</link> for more information.
</para>
<!-- Returns false if <parameter>var</parameter> is set and has a
non-empty or non-zero value; true otherwise. -->
<informalexample>
<programlisting role="php">
$var = 0;
@ -165,7 +165,7 @@ if (!isset($var)) { // evaluates false
<function>gettype</function> on a function.
</para>
<para>
See also
See also
<function>settype</function>,
<function>is_array</function>,
<function>is_bool</function>,
@ -247,7 +247,7 @@ print_r(array_keys(get_defined_vars()));
</funcsynopsis>
<para>
This function returns a string representing the type of the resource
passed to it. If the paramater is not a valid resource, it
passed to it. If the paramater is not a valid resource, it
generates an error.
<informalexample>
<programlisting role="php">
@ -290,9 +290,16 @@ echo get_resource_type($doc->doc)."\n";
base 10).
</simpara>
<simpara>
<parameter>Var</parameter> may be any scalar type. You cannot use
<parameter>var</parameter> may be any scalar type. You cannot use
<function>intval</function> on arrays or objects.
</simpara>
<note>
<para>
The <parameter>base</parameter> argument for
<function>intval</function> has no effect unless the
<parameter>var</parameter> argument is a string.
</para>
</note>
<simpara>
See also <function>doubleval</function>,
<function>strval</function>, <function>settype</function> and
@ -331,7 +338,7 @@ echo get_resource_type($doc->doc)."\n";
</para>
</refsect1>
</refentry>
<refentry id="function.is-bool">
<refnamediv>
<refname>is_bool</refname>
@ -346,13 +353,13 @@ echo get_resource_type($doc->doc)."\n";
<funcdef>bool
<function>is_bool</function>
</funcdef>
<paramdef>mixed
<paramdef>mixed
<parameter>var</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
<para>
Returns true if the <parameter>var</parameter> parameter is
Returns true if the <parameter>var</parameter> parameter is
a boolean.
</para>
<para>
@ -649,7 +656,7 @@ echo get_resource_type($doc->doc)."\n";
</simpara>
</refsect1>
</refentry>
<refentry id="function.is-resource">
<refnamediv>
<refname>is_resource</refname>
@ -661,28 +668,28 @@ echo get_resource_type($doc->doc)."\n";
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>bool
<funcdef>bool
<function>is_resource</function>
</funcdef>
<paramdef>mixed
<paramdef>mixed
<parameter>var</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
<para>
<function>is_resource</function> returns true if the variable
given by the <parameter>var</parameter> parameter is a resource,
given by the <parameter>var</parameter> parameter is a resource,
otherwise it returns false.
</para>
<para>
Resources are things like file or database result handles that
are allocated and freed by internal PHP functions and that may
need some cleanup when they are no longer in use but haven't been
freed by user code.
freed by user code.
</para>
</refsect1>
</refentry>
<refentry id="function.is-scalar">
<refnamediv>
<refname>is_scalar</refname>
@ -694,17 +701,17 @@ echo get_resource_type($doc->doc)."\n";
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>bool
<funcdef>bool
<function>is_scalar</function>
</funcdef>
<paramdef>mixed
<paramdef>mixed
<parameter>var</parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
<para>
<function>is_scalar</function> returns true if the variable
given by the <parameter>var</parameter> parameter is a scalar,
given by the <parameter>var</parameter> parameter is a scalar,
otherwise it returns false.
</para>
<para>
@ -790,7 +797,7 @@ show_var($proteins)
</para>
</refsect1>
</refentry>
<refentry id="function.isset">
<refnamediv>
<refname>isset</refname>
@ -811,9 +818,9 @@ show_var($proteins)
<para>
If a variable has been unset with <function>unset</function>,
it will no longer be <function>isset</function>. <function>isset</function>
will return <literal>false</literal> if testing a variable that has been
will return <literal>false</literal> if testing a variable that has been
set to <literal>NULL</literal>. Also note that a null byte (<literal>"\0"</literal>)
is not equivalent to the PHP <literal>NULL</literal> constant.
is not equivalent to the PHP <literal>NULL</literal> constant.
<informalexample>
<programlisting role="php">
$a = "test";
@ -822,8 +829,8 @@ echo isset ($a); // TRUE
unset ($a);
echo isset ($a); // FALSE
$foo = NULL;
print isset ($foo); // FALSE
$foo = NULL;
print isset ($foo); // FALSE
</programlisting>
</informalexample>
</para>
@ -877,10 +884,10 @@ print_r ($a);
</para>
<warning>
<para>
This function will continue forever if given an array or object
that contains a direct or indirect reference to itself or that
This function will continue forever if given an array or object
that contains a direct or indirect reference to itself or that
contains an array or object on a deeper level that does so.
This is especially true for <literal>print_r($GLOBALS)</literal>,
This is especially true for <literal>print_r($GLOBALS)</literal>,
as <literal>$GLOBALS</literal> is itself a global variable and
contains a reference to itself as such.
</para>
@ -956,7 +963,7 @@ if (!odbc_execute ($stmt, &amp;$sqldata)) {
</para>
</refsect1>
</refentry>
<refentry id="function.settype">
<refnamediv>
<refname>settype</refname>
@ -987,7 +994,7 @@ if (!odbc_execute ($stmt, &amp;$sqldata)) {
</itemizedlist>
</para>
<para>
Returns <literal>TRUE</literal> if successful; otherwise returns
Returns <literal>TRUE</literal> if successful; otherwise returns
<literal>FALSE</literal>.
</para>
<para>
@ -1180,9 +1187,9 @@ bar
was called.
<informalexample>
<programlisting role="php">
function foo(&amp;$bar) {
unset($bar);
$bar = "blah";
function foo(&amp;$bar) {
unset($bar);
$bar = "blah";
}
$bar = 'something';
@ -1206,7 +1213,7 @@ something
static variable, rather than the static variable itself.
<informalexample>
<programlisting role="php">
function foo() {
function foo() {
static $a;
$a++;
echo "$a\n";
@ -1233,7 +1240,7 @@ foo();
<informalexample>
<programlisting role="php">
function foo() {
unset($GLOBALS['bar']);
unset($GLOBALS['bar']);
}
$bar = "something";
@ -1252,7 +1259,7 @@ foo();
</para>
</refsect1>
</refentry>
<refentry id="function.var-dump">
<refnamediv>
<refname>var_dump</refname>