-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document uopz_get_static() change regarding static
- Loading branch information
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<!-- EN-Revision: b5e484908859c4d96e212fb4ec6f5af2526db288 Maintainer: mumumu Status: ready --> | ||
<refentry xml:id="function.uopz-get-static" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>uopz_get_static</refname> | ||
<refpurpose>関数またはメソッドスコープから、static変数を取得する</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis role="procedural"> | ||
<type>array</type><methodname>uopz_get_static</methodname> | ||
<methodparam><type>string</type><parameter>class</parameter></methodparam> | ||
<methodparam><type>string</type><parameter>function</parameter></methodparam> | ||
</methodsynopsis> | ||
<methodsynopsis role="procedural"> | ||
<type>array</type><methodname>uopz_get_static</methodname> | ||
<methodparam><type>string</type><parameter>function</parameter></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
関数またはメソッドスコープから、static変数を取得します。 | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>class</parameter></term> | ||
<listitem> | ||
<para> | ||
クラスの名前 | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>function</parameter></term> | ||
<listitem> | ||
<para> | ||
関数またはメソッドの名前 | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
成功した場合、現在の値にマップされた変数名の連想配列を返します。 | ||
関数やメソッド名が存在しない場合は &null; を返します。 | ||
</para> | ||
<para> | ||
PHP 8.3.0 以降では、static 変数の初期化子はコンパイル時に計算されますが、 | ||
それが不可能な場合、つまり関数やメソッドが初回実行される場合のみ、 | ||
初回実行前の static変数の値は &null; として報告されます。 | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<example xml:id="uopz-get-static.example.basic"> | ||
<title><function>uopz_get_static</function> の基本的な使い方</title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
function foo() { | ||
static $bar = 'baz'; | ||
} | ||
var_dump(uopz_get_static('foo')); | ||
?> | ||
]]> | ||
</programlisting> | ||
&example.outputs; | ||
<screen> | ||
<![CDATA[ | ||
array(1) { | ||
["bar"]=> | ||
string(3) "baz" | ||
} | ||
]]> | ||
</screen> | ||
</example> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><methodname>ReflectionFunctionAbstract::getStaticVariables</methodname></member> | ||
<member><function>uopz_set_static</function></member> | ||
</simplelist> | ||
</refsect1> | ||
|
||
</refentry> | ||
|
||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |