Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 2995

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>Pseudo-types used in this documentation</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Types"
HREF="language.types.html"><LINK
REL="PREVIOUS"
TITLE="NULL"
HREF="language.types.null.html"><LINK
REL="NEXT"
TITLE="Type Juggling"
HREF="language.types.type-juggling.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="language.types.null.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 7. Types</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="language.types.type-juggling.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="language.pseudo-types"
></A
>Pseudo-types used in this documentation</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="language.types.mixed"
></A
>mixed</H2
><P
>&#13;     <TT
CLASS="literal"
>mixed</TT
> indicates that a parameter may accept multiple (but not
     necesseraly all) types.
    </P
><P
>&#13;     <A
HREF="function.gettype.html"
><B
CLASS="function"
>gettype()</B
></A
> for example will accept all PHP types,
     while <A
HREF="function.str-replace.html"
><B
CLASS="function"
>str_replace()</B
></A
> will accept strings and arrays.
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="language.types.number"
></A
>number</H2
><P
>&#13;     <TT
CLASS="literal"
>number</TT
> indicates that a parameter can be either
     <A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
> or <A
HREF="language.types.float.html"
><B
CLASS="type"
>float</B
></A
>.
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="language.types.callback"
></A
>callback</H2
><P
>&#13;     Some functions like <B
CLASS="function"
>call_user_function()</B
> 
     or <A
HREF="function.usort.html"
><B
CLASS="function"
>usort()</B
></A
> accept user defined 
     callback functions as a parameter. Callback functions can not only
     be simple functions but also object methods including static class
     methods. 
    </P
><P
>&#13;     A PHP function is simply passed by its name as a string. You can
     pass any builtin or user defined function with the exception of 
     <A
HREF="function.array.html"
><B
CLASS="function"
>array()</B
></A
>, 
     <A
HREF="function.echo.html"
><B
CLASS="function"
>echo()</B
></A
>, 
     <A
HREF="function.empty.html"
><B
CLASS="function"
>empty()</B
></A
>, 
     <A
HREF="function.eval.html"
><B
CLASS="function"
>eval()</B
></A
>, 
     <A
HREF="function.exit.html"
><B
CLASS="function"
>exit()</B
></A
>, 
     <A
HREF="function.isset.html"
><B
CLASS="function"
>isset()</B
></A
>, 
     <A
HREF="function.list.html"
><B
CLASS="function"
>list()</B
></A
>, 
     <A
HREF="function.print.html"
><B
CLASS="function"
>print()</B
></A
> and 
     <A
HREF="function.unset.html"
><B
CLASS="function"
>unset()</B
></A
>.
    </P
><P
>&#13;     A method of an instantiated object is passed as an array containing
     an object as the element with index 0 and a method name as the 
     element with index 1.
    </P
><P
>&#13;     Static class methods can also be passed without instantiating an
     object of that class by passing the class name instead of an 
     object as the element with index 0.
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN3885"
></A
><P
><B
>Example 7-11. 
       Callback function examples
      </B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>&#60;?php 

// simple callback example
function foobar() {
    echo "hello world!";
}
call_user_function("foobar"); 

// method callback examples
class foo {
  function bar() {
    echo "hello world!";
  }
}

$foo = new foo;

call_user_function(array($foo, "bar")); // object method call

call_user_function(array("foo", "bar")); // static class method call

?&#62;</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="language.types.null.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="language.types.type-juggling.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>NULL</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="language.types.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Type Juggling</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>