svn: /phpdoc/en/trunk/language/oop5/ decon.xml
| From: | Christoph Michael Becker | Date: | Tue, 18 Aug 2015 13:41:19 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/oop5/ decon.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13623@lists.php.net to get a copy of this message | ||
cmb Tue, 18 Aug 2015 13:41:19 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337534
Log:
if __construct() and old-style constructor are present, PHP chooses whichever
comes first (fixes #66926)
Bug: https://bugs.php.net/66926 (Verified) old-style
constructor and __construct()
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-08-18 12:31:12 UTC (rev 337533)
+++ phpdoc/en/trunk/language/oop5/decon.xml 2015-08-18 13:41:19 UTC (rev 337534)
@@ -62,13 +62,15 @@
</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
- search for the old-style constructor function, by the name of the class.
+ For backwards compatibility, if a
+ class did not inherit a <link
linkend="object.construct">__construct()</link> from a parent class,
+ either __construct() or the
+ old-style constructor function with the name of the class will be used as constructor function,
+ whichever comes first.
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,
+ and which came lexically before the old-style constructor.
</para>
<para>
Unlike with other methods, PHP will not generate an