Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 3361

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Halts the compiler execution</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.get-browser.html">get_browser</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.highlight-file.html">highlight_file</a></div>
 <div class="up"><a href="ref.misc.html">Misc. Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.halt-compiler" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">__halt_compiler</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0)</p><p class="refpurpose"><span class="refname">__halt_compiler</span> &mdash; <span class="dc-title">
   Halts the compiler execution
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.halt-compiler-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>__halt_compiler</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Halts the execution of the compiler. This can be useful to embed data in
   PHP scripts, like the installation files.
  </p>
  <p class="para">
   Byte position of the data start can be determined by the
   <strong><code>__COMPILER_HALT_OFFSET__</code></strong> constant which is defined
   only if there is a  <span class="function"><strong>__halt_compiler()</strong></span> presented in the
   file.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.halt-compiler-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.halt-compiler-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3779">
    <p><strong>Example #1 A  <span class="function"><strong>__halt_compiler()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;open&nbsp;this&nbsp;file<br /></span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;seek&nbsp;file&nbsp;pointer&nbsp;to&nbsp;data<br /></span><span style="color: #0000BB">fseek</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">__COMPILER_HALT_OFFSET__</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;and&nbsp;output&nbsp;it<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">stream_get_contents</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">//&nbsp;the&nbsp;end&nbsp;of&nbsp;the&nbsp;script&nbsp;execution<br /></span><span style="color: #007700">__halt_compiler();&nbsp;</span><span style="color: #0000BB">the&nbsp;installation&nbsp;data&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">eg</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">tar</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">gz</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PHP</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">etc</span><span style="color: #007700">.)</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.halt-compiler-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
     <span class="function"><strong>__halt_compiler()</strong></span> can only be used from the outermost
    scope.
   </p>
  </p></blockquote>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.get-browser.html">get_browser</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.highlight-file.html">highlight_file</a></div>
 <div class="up"><a href="ref.misc.html">Misc. Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>