Doc #66926 [Com]: old-style constructor and __construct()
| From: | miksir at maker dot ru | Date: | Fri, 04 Sep 2015 11:59:45 +0000 |
| Subject: | Doc #66926 [Com]: old-style constructor and __construct() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12721@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66926&edit=1
ID: 66926
Comment by: miksir at maker dot ru
Reported by: wako057 at gmail dot com
Summary: old-style constructor and __construct()
Status: Not a bug
Type: Documentation Problem
Package: Scripting Engine problem
Operating System: Debian
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
You are welcome =)
And to wako057:
It's not a bug, it's feature :) https://bugs.php.net/bug.php?id=52160
Emit E_STRICT in second case not possible because it's broke legal PHP5 code.
But in first case E_STRICT still emitted because very low chance that constructor is not first
method in class.
So, this strange behavior - is the balance between legal PHP5 code, BC with PHP4 code and warning
about BC break (about this one: "Effectively, it means that the only case that would have
compatibility issues is if the class had a method named __construct() which was used for different
semantics")
Previous Comments:
------------------------------------------------------------------------
[2015-09-03 22:17:40] cmb@php.net
Thanks for pointing out my mistake, miksir! :)
So actually, this is not a bug.
------------------------------------------------------------------------
[2015-09-03 22:15:19] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=337740
Log: reverted erroneous fix for bug #66926
------------------------------------------------------------------------
[2015-09-03 21:21:11] miksir at maker dot ru
PHP5 always use __construct, not whichever comes first
https://3v4l.org/7eg0E
https://3v4l.org/K0FqA
------------------------------------------------------------------------
[2015-08-18 13:41:56] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
------------------------------------------------------------------------
[2015-08-18 13:41:21] cmb@php.net
Automatic comment from SVN on behalf of cmb
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)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=66926
--
Edit this bug report at https://bugs.php.net/bug.php?id=66926&edit=1