mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
119 lines
4.8 KiB
HTML
119 lines
4.8 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>Sets the static variables in function or method scope</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.uopz-set-static" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">uopz_set_static</h1>
|
|
<p class="verinfo">(PECL uopz 5)</p><p class="refpurpose"><span class="refname">uopz_set_static</span> — <span class="dc-title">Sets the static variables in function or method scope</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.uopz-set-static-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>uopz_set_static</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$function</code></span>
|
|
, <span class="methodparam"><span class="type">array</span> <code class="parameter">$static</code></span>
|
|
) : <span class="type"><span class="type void">void</span></span></div>
|
|
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>uopz_set_static</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="methodparam"><span class="type">array</span> <code class="parameter">$static</code></span>
|
|
) : <span class="type"><span class="type void">void</span></span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Sets the static variables in function or method scope.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.uopz-set-static-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">class</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The name of the class.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">function</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The name of the function or method.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">static</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The associative <span class="type"><a href="language.types.array.html" class="type array">array</a></span> of variable names mapped to their
|
|
values.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.uopz-set-static-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
没有返回值。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.uopz-set-static-examples">
|
|
<h3 class="title">范例</h3>
|
|
<div class="example" id="example-593">
|
|
<p><strong>Example #1 Basic <span class="function"><strong>uopz_set_static()</strong></span> Usage</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">foo</span><span style="color: #007700">() {<br /> static </span><span style="color: #0000BB">$bar </span><span style="color: #007700">= </span><span style="color: #DD0000">'baz'</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$bar</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">uopz_set_static</span><span style="color: #007700">(</span><span style="color: #DD0000">'foo'</span><span style="color: #007700">, [</span><span style="color: #DD0000">'bar' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'qux'</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB">foo</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(3) "qux"
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.uopz-set-static-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="uopz_get_static.html" class="function" rel="rdfs-seeAlso">uopz_get_static()</a> - Gets the static variables from function or method scope</span></li>
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |