mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
102 lines
4.3 KiB
HTML
102 lines
4.3 KiB
HTML
<!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>Copy a function</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.uopz-copy" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">uopz_copy</h1>
|
|
<p class="verinfo">(PECL uopz 1 >= 1.0.4, PECL uopz 2)</p><p class="refpurpose"><span class="refname">uopz_copy</span> — <span class="dc-title">Copy a function</span></p>
|
|
|
|
</div>
|
|
|
|
<div id="function.uopz-copy-refsynopsisdiv">
|
|
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function has been
|
|
<em class="emphasis">REMOVED</em> in PECL uopz 5.0.0.</p></div>
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.uopz-copy-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>uopz_copy</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$function</code></span>
|
|
) : <span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span></div>
|
|
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>uopz_copy</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$class</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$function</code></span>
|
|
) : <span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Copy a function by name
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.uopz-copy-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">class</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The name of the class containing the function to copy
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">function</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The name of the function
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.uopz-copy-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
A Closure for the specified function
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.uopz-copy-examples">
|
|
<h3 class="title">范例</h3>
|
|
<div class="example" id="example-565">
|
|
<p><strong>Example #1 <span class="function"><strong>uopz_copy()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br />$strtotime </span><span style="color: #007700">= </span><span style="color: #0000BB">uopz_copy</span><span style="color: #007700">(</span><span style="color: #DD0000">'strtotime'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">uopz_function</span><span style="color: #007700">(</span><span style="color: #DD0000">"strtotime"</span><span style="color: #007700">, function(</span><span style="color: #0000BB">$arg1</span><span style="color: #007700">, </span><span style="color: #0000BB">$arg2</span><span style="color: #007700">) use(</span><span style="color: #0000BB">$strtotime</span><span style="color: #007700">) {<br /> </span><span style="color: #FF8000">/* can call original strtotime from here */<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$arg1</span><span style="color: #007700">);<br />});<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">'dummy'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程会输出:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
string(5) "dummy"
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |