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

From: Date: Tue, 17 Dec 2019 15:50:14 +0000
Subject: svn: /phpdoc/ja/trunk/language/ operators.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-5165@lists.php.net to get a copy of this message
mumumu Tue, 17 Dec 2019 15:50:14 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=348560 Log: Fix #78977: Assigning the return value of new is a syntax error instead of deprecated Bug: https://bugs.php.net/78977 (Open) Assigning the return value of new is a syntax error instead of deprecated Bug: https://bugs.php.net/78977 (Closed) Assigning the return value of new is a syntax error instead of deprecated Changed paths: U phpdoc/ja/trunk/language/operators.xml Modified: phpdoc/ja/trunk/language/operators.xml =================================================================== --- phpdoc/ja/trunk/language/operators.xml 2019-12-17 15:33:05 UTC (rev 348559) +++ phpdoc/ja/trunk/language/operators.xml 2019-12-17 15:50:14 UTC (rev 348560) @@ -541,12 +541,13 @@ <para> PHP 5 以降では、<link linkend="language.oop5.basic.new">new</link> 演算子が自動的に参照を返すようになりました。そのため、 - <link linkend="language.oop5.basic.new">new</link> の結果を参照で代入しようとすると - PHP 5.3 以降では <constant>E_DEPRECATED</constant>、それより前のバージョンでは - <constant>E_STRICT</constant> が発生します。 + <link linkend="language.oop5.basic.new">new</link> の結果を参照で代入することは + PHP 7.0.0 から許されなくなりました。 + それより前のバージョンでは、PHP 5.3 以降では <constant>E_DEPRECATED</constant>、それより前のバージョンでは + <constant>E_STRICT</constant> が発生していました。 </para> <para> - たとえば、このコードは警告が発生します。 + たとえば、このコードはエラーが出るか、警告が発生します。 <informalexample> <programlisting role="php"> <![CDATA[ @@ -553,13 +554,28 @@ <?php class C {} -/* 次の行を実行すると、このようなエラーメッセージが出ます - * Deprecated: Assigning the return value of new by reference is deprecated in... - */ $o = &new C; ?> ]]> </programlisting> + &example.outputs.7; + <screen> +<![CDATA[ +Parse error: syntax error, unexpected 'new' (T_NEW) in … +]]> + </screen> + &example.outputs.53; + <screen> +<![CDATA[ +Deprecated: Assigning the return value of new by reference is deprecated in … +]]> + </screen> + &example.outputs.5; + <screen> +<![CDATA[ +Strict Standards: Assigning the return value of new by reference is deprecated in … +]]> + </screen> </informalexample> </para> <para>

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