svn: /phpdoc/en/trunk/language/oop5/ decon.xml
| From: | Adam Harvey | Date: | Fri, 04 Sep 2015 20:56:08 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/oop5/ decon.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13712@lists.php.net to get a copy of this message | ||
aharvey Fri, 04 Sep 2015 20:56:08 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337754
Log:
Note deprecation of old style constructors in PHP 7.
Changed paths:
U phpdoc/en/trunk/language/oop5/decon.xml
Modified: phpdoc/en/trunk/language/oop5/decon.xml
===================================================================
--- phpdoc/en/trunk/language/oop5/decon.xml 2015-09-04 17:55:51 UTC (rev 337753)
+++ phpdoc/en/trunk/language/oop5/decon.xml 2015-09-04 20:56:08 UTC (rev 337754)
@@ -62,14 +62,24 @@
</programlisting>
</example>
<para>
- For backwards compatibility, if PHP 5 cannot find a
- <link linkend="object.construct">__construct()</link> function for a
given class, and the
- class did not inherit one from a parent class, it will
+ For backwards compatibility with PHP 3 and 4, if PHP cannot find a
+ <link linkend="object.construct">__construct()</link> function for a
given
+ class, and the class did not inherit one from a parent class, it will
search for the old-style constructor function, by the name of the class.
Effectively, it means that the only case that would have compatibility
issues is if the class had a method named
- <link linkend="object.construct">__construct()</link> which was used for
different semantics.
+ <link linkend="object.construct">__construct()</link> which was used for
+ different semantics.
</para>
+ <!-- Not using an entity because I want specific wording here, since we're
+ not deprecating constructors in general. -->
+ <warning>
+ <simpara>
+ Old style constructors are <emphasis>DEPRECATED</emphasis> in PHP 7.0, and
+ will be removed in a future version. You should always use
+ <link linkend="object.construct">__construct()</link> in new code.
+ </simpara>
+ </warning>
<para>
Unlike with other methods, PHP will not generate an
<constant>E_STRICT</constant> level error message when