svn: /phpdoc/en/trunk/ appendices/migration70/incompatible/other.xml language/oop5/basic.xml
| From: | Christoph Michael Becker | Date: | Tue, 21 Jun 2016 14:38:50 +0000 |
| Subject: | svn: /phpdoc/en/trunk/ appendices/migration70/incompatible/other.xml language/oop5/basic.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-14224@lists.php.net to get a copy of this message | ||
cmb Tue, 21 Jun 2016 14:38:50 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339436
Log:
Fix #72462: documentation about static calls from secondary object is outdated
Bug: https://bugs.php.net/72462 (Open) documentation about
static calls from secondary object is outdated
Changed paths:
U phpdoc/en/trunk/appendices/migration70/incompatible/other.xml
U phpdoc/en/trunk/language/oop5/basic.xml
Modified: phpdoc/en/trunk/appendices/migration70/incompatible/other.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration70/incompatible/other.xml 2016-06-21 11:58:49 UTC (rev
339435)
+++ phpdoc/en/trunk/appendices/migration70/incompatible/other.xml 2016-06-21 14:38:50 UTC (rev
339436)
@@ -151,7 +151,7 @@
?>
]]>
</programlisting>
- &example.outputs.5;
+ &example.outputs.56;
<screen>
<![CDATA[
Deprecated: Non-static method A::test() should not be called statically, assuming $this from
incompatible context in /tmp/test.php on line 8
Modified: phpdoc/en/trunk/language/oop5/basic.xml
===================================================================
--- phpdoc/en/trunk/language/oop5/basic.xml 2016-06-21 11:58:49 UTC (rev 339435)
+++ phpdoc/en/trunk/language/oop5/basic.xml 2016-06-21 14:38:50 UTC (rev 339436)
@@ -52,10 +52,21 @@
possibly another object, if the method is called
<link linkend="language.oop5.static">statically</link> from the context
of a secondary object).
+ As of PHP 7.0.0 calling a non-static method statically from an incompatible
+ context results in $this being undefined inside the method. Calling a
+ non-static method statically from an incompatible context has been
+ deprecated as of PHP 5.6.0. As of PHP 7.0.0 calling a non-static method
+ statically has been generally deprecated (even if called from a compatible
+ context). Before PHP 5.6.0 such calls already triggered a strict notice.
</para>
<para>
<example xml:id="language.oop5.basic.class.this">
<title>Some examples of the <varname>$this</varname>
pseudo-variable</title>
+ <simpara>
+ We're assuming that error_reporting is disabled for this example;
+ otherwise the following code would trigger deprecated and strict notices,
+ respectively, depending on the PHP version.
+ </simpara>
<programlisting role="php">
<![CDATA[
<?php
@@ -77,7 +88,6 @@
{
function bar()
{
- // Note: the next line will issue a warning if E_STRICT is enabled.
A::foo();
}
}
@@ -85,17 +95,15 @@
$a = new A();
$a->foo();
-// Note: the next line will issue a warning if E_STRICT is enabled.
A::foo();
$b = new B();
$b->bar();
-// Note: the next line will issue a warning if E_STRICT is enabled.
B::bar();
?>
]]>
</programlisting>
- &example.outputs;
+ &example.outputs.5;
<screen>
<![CDATA[
$this is defined (A)
@@ -104,6 +112,15 @@
$this is not defined.
]]>
</screen>
+ &example.outputs.7;
+ <screen>
+<![CDATA[
+$this is defined (A)
+$this is not defined.
+$this is not defined.
+$this is not defined.
+]]>
+ </screen>
</example>
</para>
</sect2>