Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97749 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34405 invoked from network); 14 Jan 2017 10:20:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2017 10:20:26 -0000 Authentication-Results: pb1.pair.com header.from=andreas@heigl.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andreas@heigl.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain heigl.org from 195.191.240.18 cause and error) X-PHP-List-Original-Sender: andreas@heigl.org X-Host-Fingerprint: 195.191.240.18 hos109.unaxus.net Received: from [195.191.240.18] ([195.191.240.18:55359] helo=hos109.unaxus.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/E5-00729-26BF9785 for ; Sat, 14 Jan 2017 05:20:20 -0500 Received: from heigl.gw.tgnet.de ([80.72.250.242]:55497 helo=wdv-hg-0C07-zX4090-HeiglAndreas.local) by hos109.unaxus.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cSLRW-000CAH-7O; Sat, 14 Jan 2017 11:20:14 +0100 To: internals@lists.php.net, Wes , sebastian@php.net References: <0DE25BF8-D349-48EF-A83B-8837DD4AD1E0@gmail.com> <5efcc230-c67b-4439-cc82-b31eacbf36db@php.net> <7c8c8801-a849-6fd2-91e9-954030c55e83@fleshgrinder.com> Message-ID: Date: Sat, 14 Jan 2017 11:20:09 +0100 MIME-Version: 1.0 In-Reply-To: <7c8c8801-a849-6fd2-91e9-954030c55e83@fleshgrinder.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms090408080203010600000807" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hos109.unaxus.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heigl.org X-Get-Message-Sender-Via: hos109.unaxus.net: authenticated_id: a.heigl+heigl.org/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hos109.unaxus.net: a.heigl@heigl.org Subject: Re: [PHP-DEV] Explicit constructor call and polymorphic dispatch From: andreas@heigl.org (Andreas Heigl) --------------ms090408080203010600000807 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi All. Am 14.01.17 um 11:03 schrieb Fleshgrinder: > On 1/13/2017 8:24 AM, Wes wrote: [=E2=80=A6] > On 1/13/2017 8:24 AM, Wes wrote: >>> the only reason for prohibiting explicit __construct calls is that it= makes >>> PHP objects mutable >> >> >> then don't call it explicitly, exactly like you wouldn't use reflectio= n to >> call private methods >> >=20 > This is one possible answer to this issue. The question is whether PHP > wants to protect developers from errors and help reduce bugs by > enforcing things or wants to be a purely convention based language and > leave it developers to use it correctly. >=20 > I am completely in favor of #1 and you seem to be in favor of #2. >=20 > I actually have the impression that it is not defined which of both PHP= > actually is or wants to be. The introduction of scalar type hints in PH= P > 7 definitely points towards #1 but it could just be an outlier. Do we as "makers of PHP" want to dictate the user what the "intended" behaviour of PHP is? Or are we treating the user as a responsible person that knows what to do and also not to do? Personally I'm in favour of the later. Let the user be able to call __construct whenever they like. It's a special method which is clearly visible by the two underscores at the start. So the users either know exactly what they are doing or they need to learn it. Translated to a different example this discussion is like: "Let's remove the handle from the window because someone might be able to open the window and jump out of it". The handle is there for a valid reason. And as a window-maker I have no idea in what way it might be used. But I have to accept that there are people missusing it. But should I limit all those users with a valid use-case for it just to save some from missusing it? And if we start with that, where should we stop? Just my 0.02=E2=82=AC Cheers Andreas >=20 --=20 ,,, (o o) +---------------------------------------------------------ooO-(_)-Ooo-+ | Andreas Heigl | | mailto:andreas@heigl.org N 50=C2=B022'59.5" E 08=C2=B0= 23'58" | | http://andreas.heigl.org http://hei.gl/wiFKy7 | +---------------------------------------------------------------------+ | http://hei.gl/root-ca | +---------------------------------------------------------------------+ --------------ms090408080203010600000807 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCC BawwggWoMIIDkKADAgECAgMSOD4wDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN MTYwNzIzMDkxNjU1WhcNMTgwNzIzMDkxNjU1WjBcMRYwFAYDVQQDEw1BbmRyZWFzIEhlaWds MSAwHgYJKoZIhvcNAQkBFhFhLmhlaWdsQGhlaWdsLm9yZzEgMB4GCSqGSIb3DQEJARYRYW5k cmVhc0BoZWlnbC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCn6XLcWFLD vAXgllUikBAU2Rv63m7ZKP+ZU/2HTWDW0BJ2muK7GD3cGZxbKKosO6l6PSqqmLqUJ8G6b/85 iPQmNL5z+LG/+wt/p31SOMAWc5UA7CJAQ9pivUCcV+Yt0LzoxWO5ME2rEZ/ioB2tXMilkJLM U4f5A9m3YZVSKj3xbM7rIpQEZiK0TrZ4MchTwPMdAwBLBxCoAztcg4Yj4qKd+IQLff0Ldhc5 3tc9b+XT7YzWLY5rQKHE+hKqIAdvYfqqKQZFHBBXptSXUXBeYK5a4UT0fpnMP7toqr/9mLlK +FvDNeVwSo5I/abiqdek1lH0/xwYy9im8k4SRtLTAp7hAgMBAAGjggFUMIIBUDAMBgNVHRMB Af8EAjAAMFYGCWCGSAGG+EIBDQRJFkdUbyBnZXQgeW91ciBvd24gY2VydGlma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