svn: /phpdoc/ja/trunk/language/ functions.xml

From: Date: Sun, 30 Apr 2017 01:28:25 +0000
Subject: svn: /phpdoc/ja/trunk/language/ functions.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-4691@lists.php.net to get a copy of this message
satoruyoshida Sun, 30 Apr 2017 01:28:25 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=342439 Log: sync en, but Status is working. Changed paths: U phpdoc/ja/trunk/language/functions.xml Modified: phpdoc/ja/trunk/language/functions.xml =================================================================== --- phpdoc/ja/trunk/language/functions.xml 2017-04-29 20:57:49 UTC (rev 342438) +++ phpdoc/ja/trunk/language/functions.xml 2017-04-30 01:28:25 UTC (rev 342439) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> -<!-- EN-Revision: 340960 Maintainer: takagi Status: ready --> +<!-- EN-Revision: 342208 Maintainer: takagi Status: working --> <!-- CREDITS: hirokawa --> <chapter xml:id="language.functions" xmlns="http://docbook.org/ns/docbook"> <title>関数</title> @@ -1376,6 +1376,9 @@ <simpara> クロージャは、変数を親のスコープから引き継ぐことができます。 引き継ぐ変数は、<literal>use</literal> で渡さなければなりません。 + <!-- to be translated --> + From PHP 7.1, these variables must not include &link.superglobals;, + <varname>$this</varname>, or variables with the same name as a parameter. </simpara> <example> @@ -1566,14 +1569,18 @@ <![CDATA[ <?php -new class { +class Foo +{ function __construct() { - (static function() { + $func = static function() { var_dump($this); - })(); + }; + $func(); } }; +new Foo(); + ?> ]]> </programlisting> @@ -1594,16 +1601,19 @@ <![CDATA[ <?php -(static function() { +$func = static function() { // 関数の本体 -})->call(new StdClass); +}; +$func = $func->bindTo(new StdClass); +$func(); + ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ -Warning: Cannot bind an instance to a static closure in /in/sLLS9 on line 5 +Warning: Cannot bind an instance to a static closure in %s on line %d ]]> </screen> </example> @@ -1623,6 +1633,15 @@ </thead> <tbody> <row> + <entry>7.1.0</entry> + <entry> + <!-- to be translated --> + Anonymous functions may not close over &link.superglobals;, + <varname>$this</varname>, or any variable with the same name as a + parameter. + </entry> + </row> + <row> <entry>5.4.0</entry> <entry> 無名関数で、静的に宣言したときのように

« previous php.doc.ja (#4691) next »