vrana Wed Sep 21 08:43:14 2005 EDT
Modified files:
/phpdoc/en/appendices reserved.constants.core.xml
/phpdoc/en/language control-structures.xml
Log:
Document __halt_compiler()
http://cvs.php.net/diff.php/phpdoc/en/appendices/reserved.constants.core.xml?r1=1.17&r2=1.18&ty=u
Index: phpdoc/en/appendices/reserved.constants.core.xml
diff -u phpdoc/en/appendices/reserved.constants.core.xml:1.17
phpdoc/en/appendices/reserved.constants.core.xml:1.18
--- phpdoc/en/appendices/reserved.constants.core.xml:1.17 Mon Jun 6
10:51:53 2005
+++ phpdoc/en/appendices/reserved.constants.core.xml Wed Sep 21 08:43:13 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.17 $ -->
+<!-- $Revision: 1.18 $ -->
<sect2 id="reserved.constants.core">
<title>Core Predefined Constants</title>
<simpara>
@@ -348,6 +348,17 @@
</simpara>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ <constant>__COMPILER_HALT_OFFSET__</constant>
+ (<type>integer</type>)
+ </term>
+ <listitem>
+ <simpara>
+ Available since PHP 5.1.0
+ </simpara>
+ </listitem>
+ </varlistentry>
</variablelist>
<para>
See also: <link linkend="language.constants.predefined">Magic
http://cvs.php.net/diff.php/phpdoc/en/language/control-structures.xml?r1=1.125&r2=1.126&ty=u
Index: phpdoc/en/language/control-structures.xml
diff -u phpdoc/en/language/control-structures.xml:1.125
phpdoc/en/language/control-structures.xml:1.126
--- phpdoc/en/language/control-structures.xml:1.125 Wed Sep 7 07:31:45 2005
+++ phpdoc/en/language/control-structures.xml Wed Sep 21 08:43:14 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.125 $ -->
+<!-- $Revision: 1.126 $ -->
<chapter id="language.control-structures">
<title>Control Structures</title>
@@ -1761,6 +1761,38 @@
and <function>virtual</function>.
</para>
</sect1>
+
+ <sect1 id="function.--halt-compiler">
+ <title><function>__halt_compiler</function></title>
+ <para>
+ The <function>__halt_compiler</function> statement stops the processing of
+ PHP instructions.
+ </para>
+ <para>
+ The main purpose of this statement is to allow creating scripts containing
+ any data (possibly also <link linkend="language.basic-syntax.phpmode">PHP
+ start tags</link>) such as one-file installers. Byte position of the data
+ start can be determined by the
+ <constant>__COMPILER_HALT_OFFSET__</constant> constant which is defined
+ only if there is a <function>__halt_compiler</function> presented in the
+ file.
+ </para>
+ <example>
+ <title><function>__halt_compiler</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo file_get_contents(__FILE__, false, NULL, __COMPILER_HALT_OFFSET__);
+__halt_compiler();some archive data, which can be binary
+]]>
+ </programlisting>
+ </example>
+ <note>
+ <para>
+ <function>__halt_compiler</function> was added in PHP 5.1.
+ </para>
+ </note>
+ </sect1>
</chapter>