Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 9085

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>php_check_syntax</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="Miscellaneous Functions"
HREF="ref.misc.html"><LINK
REL="PREVIOUS"
TITLE="pack"
HREF="function.pack.html"><LINK
REL="NEXT"
TITLE="php_strip_whitespace"
HREF="function.php-strip-whitespace.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
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 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.pack.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.php-strip-whitespace.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.php-check-syntax"
></A
>php_check_syntax</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN125904"
></A
><P
>    (PHP 5 &#60;= 5.0.4)</P
>php_check_syntax&nbsp;--&nbsp;
   Check the PHP syntax of (and execute) the specified file
  </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN125907"
></A
><H2
>说明</H2
>bool <B
CLASS="methodname"
>php_check_syntax</B
> ( string filename [, string &#38;error_message] )<BR
></BR
><P
>&#13;   Performs a syntax (lint) check on the specified 
   <CODE
CLASS="parameter"
>filename</CODE
> testing for scripting errors.
  </P
><P
>&#13;   This is similar to using <B
CLASS="command"
>php -l</B
> from the <A
HREF="features.commandline.html"
>commandline</A
> except that this
   function will execute (but not output) the checked
   <CODE
CLASS="parameter"
>filename</CODE
>.
  </P
><P
>&#13;   For example, if a function is defined in <CODE
CLASS="parameter"
>filename</CODE
>,
   this defined function will be available to the file that executed 
   <B
CLASS="function"
>php_check_syntax()</B
>, but output from 
   <CODE
CLASS="parameter"
>filename</CODE
> will be suppressed.
  </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>注意: </B
>
    For technical reasons, this function is deprecated and removed from PHP.
    Instead, use <TT
CLASS="literal"
>php -l somefile.php</TT
> from the 
    <A
HREF="features.commandline.html"
>commandline</A
>.
   </P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN125932"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>filename</CODE
></DT
><DD
><P
>&#13;       The name of the file being checked.
      </P
></DD
><DT
><CODE
CLASS="parameter"
>error_message</CODE
></DT
><DD
><P
>&#13;       If the <CODE
CLASS="parameter"
>error_message</CODE
> parameter is used, it will
       contain the error message generated by the syntax check. 
       <CODE
CLASS="parameter"
>error_message</CODE
> is passed by 
       <A
HREF="language.references.html"
>reference</A
>.
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN125949"
></A
><H2
>返回值</H2
><P
>&#13;   Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the lint check passed, and <TT
CLASS="constant"
><B
>FALSE</B
></TT
> if the link check
   failed or if <CODE
CLASS="parameter"
>filename</CODE
> cannot be opened.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN125955"
></A
><H2
>更新日志</H2
><P
>&#13;   <DIV
CLASS="informaltable"
><P
></P
><A
NAME="AEN125958"
></A
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>版本</TH
><TH
>说明</TH
></TR
></THEAD
><TBODY
><TR
><TD
>5.0.5</TD
><TD
>&#13;        This function was removed from PHP.
       </TD
></TR
><TR
><TD
>5.0.3</TD
><TD
>&#13;        Calling <A
HREF="function.exit.html"
><B
CLASS="function"
>exit()</B
></A
> after 
        <B
CLASS="function"
>php_check_syntax()</B
> resulted in a Segfault.
       </TD
></TR
><TR
><TD
>5.0.1</TD
><TD
>&#13;        <CODE
CLASS="parameter"
>error_message</CODE
> is passed by reference.
       </TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN125977"
></A
><H2
>范例</H2
><P
>&#13;   <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="screen"
>php -l somefile.php</PRE
></TD
></TR
></TABLE
>
  </P
><P
>上例的输出类似于:</P
><P
>&#13;   <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="screen"
>PHP Parse error: unexpected T_STRING in /tmp/somefile.php on line 81</PRE
></TD
></TR
></TABLE
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN125984"
></A
><H2
>参见</H2
><P
>&#13;   <P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="function.include.html"
><B
CLASS="function"
>include()</B
></A
></TD
></TR
><TR
><TD
><A
HREF="function.is-readable.html"
><B
CLASS="function"
>is_readable()</B
></A
></TD
></TR
></TBODY
></TABLE
><P
></P
>
  </P
></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="function.pack.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.php-strip-whitespace.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>pack</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.misc.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>php_strip_whitespace</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>