<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/language.operators.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'language.operators.execution.php',
    1 => '実行演算子',
    2 => '実行演算子',
  ),
  'up' => 
  array (
    0 => 'language.operators.php',
    1 => '演算子',
  ),
  'prev' => 
  array (
    0 => 'language.operators.errorcontrol.php',
    1 => 'エラー制御演算子',
  ),
  'next' => 
  array (
    0 => 'language.operators.logical.php',
    1 => '論理演算子',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'language/operators/execution.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="language.operators.execution" class="sect1">
 <h2 class="title">実行演算子</h2>
 
 <p class="para">
  PHP は 1 種類の実行演算子、バッククォート (<code class="literal">``</code>) をサポートします。
  シングルクォートではないことに注意してください! PHP は、バッククォートの
  中身をシェルコマンドとして実行しようとします。出力が返されます
  (すなわち、出力を単にダンプするのではなく、変数に代入することが
  できます) 。
  バッククォート演算子の使用は <span class="function"><a href="function.shell-exec.php" class="function">shell_exec()</a></span> と等価です。
 </p>
 <p class="para">
  <div class="example" id="example-1">
   <p><strong>例1 バッククォート演算子</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$output </span><span style="color: #007700">= `</span><span style="color: #DD0000">ls -al</span><span style="color: #007700">`;<br />echo </span><span style="color: #DD0000">"&lt;pre&gt;</span><span style="color: #0000BB">$output</span><span style="color: #DD0000">&lt;/pre&gt;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </p>
 <blockquote class="note"><p><strong class="note">注意</strong>: 
  <p class="para">
   バッククォート演算子は、
   <span class="function"><a href="function.shell-exec.php" class="function">shell_exec()</a></span> が無効な場合は無効となります。
  </p>
 </p></blockquote>
 <blockquote class="note"><p><strong class="note">注意</strong>: 
  <p class="para">
   他の言語とは異なり、
   ダブルクォートで囲まれた文字列の中でのバッククォート演算子には何の効力もありません。
  </p>
 </p></blockquote>

 <div class="sect2">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.5.0</td>
      <td>
       <span class="function"><a href="function.shell-exec.php" class="function">shell_exec()</a></span>
       のエイリアスとして使われているバッククォート演算子は、
       推奨されなくなりました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>

 <div class="sect2">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="ref.exec.php" class="link">システムプログラムの実行</a></li>
    <li><span class="function"><a href="function.popen.php" class="function">popen()</a></span></li>
    <li><span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span></li>
    <li><a href="features.commandline.php" class="link">PHPをコマンドラインから使用する</a></li>
   </ul>
  </p>
 </div>
</div><?php manual_footer($setup); ?>