<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.luasandbox.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'luasandbox.wrapphpfunction.php',
    1 => 'LuaSandbox::wrapPhpFunction',
    2 => 'Wrap a PHP callable in a LuaSandboxFunction',
  ),
  'up' => 
  array (
    0 => 'class.luasandbox.php',
    1 => 'LuaSandbox',
  ),
  'prev' => 
  array (
    0 => 'luasandbox.unpauseusagetimer.php',
    1 => 'LuaSandbox::unpauseUsageTimer',
  ),
  'next' => 
  array (
    0 => 'class.luasandboxfunction.php',
    1 => 'LuaSandboxFunction',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/luasandbox/luasandbox/wrapphpfunction.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="luasandbox.wrapphpfunction" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">LuaSandbox::wrapPhpFunction</h1>
  <p class="verinfo">(PECL luasandbox &gt;= 1.2.0)</p><p class="refpurpose"><span class="refname">LuaSandbox::wrapPhpFunction</span> &mdash; <span class="dc-title">Wrap a PHP callable in a <span class="classname"><a href="class.luasandboxfunction.php" class="classname">LuaSandboxFunction</a></span></span></p>

 </div>

 <div class="refsect1 description" id="refsect1-luasandbox.wrapphpfunction-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>LuaSandbox::wrapPhpFunction</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$function</code></span>): <span class="type"><a href="class.luasandboxfunction.php" class="type LuaSandboxFunction">LuaSandboxFunction</a></span></div>

  <p class="simpara">
   Wraps a PHP callable in a <span class="classname"><a href="class.luasandboxfunction.php" class="classname">LuaSandboxFunction</a></span>, so it
   can be passed into Lua as an anonymous function.
  </p>
  <p class="simpara">
   The function must return either an array of values (which may be empty),
   or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> which is equivalent to returning the empty array.
  </p>
  <p class="simpara">
   Exceptions will be raised as errors in Lua, however only
   <span class="classname"><a href="class.luasandboxruntimeerror.php" class="classname">LuaSandboxRuntimeError</a></span> exceptions may be caught
   inside Lua with <code class="literal">pcall()</code> or <code class="literal">xpcall()</code>.
  </p>
  <p class="simpara">
   For more information about calling Lua functions and the return values,
   see <span class="methodname"><a href="luasandboxfunction.call.php" class="methodname">LuaSandboxFunction::call()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-luasandbox.wrapphpfunction-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">function</code></dt>
    <dd>
     <span class="simpara">
      Callable to wrap.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-luasandbox.wrapphpfunction-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   Returns a <span class="classname"><a href="class.luasandboxfunction.php" class="classname">LuaSandboxFunction</a></span>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-luasandbox.wrapphpfunction-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="luasandbox.loadstring.php" class="methodname" rel="rdfs-seeAlso">LuaSandbox::loadString()</a> - Load Lua code into the Lua environment</span></li>
   <li><span class="methodname"><a href="luasandbox.registerlibrary.php" class="methodname" rel="rdfs-seeAlso">LuaSandbox::registerLibrary()</a> - Register a set of PHP functions as a Lua library</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>