Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91246 invoked from network); 26 May 2016 19:17:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 May 2016 19:17:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.84 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.84 mx103.easyname.com Received: from [77.244.243.84] ([77.244.243.84:48725] helo=mx202.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/CD-17600-AAB47475 for ; Thu, 26 May 2016 15:16:59 -0400 Received: from cable-81-173-133-15.netcologne.de ([81.173.133.15] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b60m8-00044U-8E; Thu, 26 May 2016 19:16:56 +0000 Reply-To: internals@lists.php.net References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> <5fd54aa0-4fdf-c1e7-eae8-765aa89c8498@fleshgrinder.com> <08963b03-8394-6d62-4e5b-393f3fcb5647@fleshgrinder.com> <9e9db70d-d72d-d93e-0c81-18c2aa228618@gmail.com> <409002d8-b5e3-5990-7358-246adc7e3cab@fleshgrinder.com> <57474A08.80807@lsces.co.uk> To: Lester Caine , internals@lists.php.net Message-ID: <6f7403b6-bf22-a12b-dfb2-43fe82983e7d@fleshgrinder.com> Date: Thu, 26 May 2016 21:16:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <57474A08.80807@lsces.co.uk> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kfgxddCKPh33V6JLqlAv9iudFRrvt0Sgs" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: php@fleshgrinder.com (Fleshgrinder) --kfgxddCKPh33V6JLqlAv9iudFRrvt0Sgs Content-Type: multipart/mixed; boundary="LJ9b4qHVKo8NUdOad087sT3Mw06vIuf41" From: Fleshgrinder Reply-To: internals@lists.php.net To: Lester Caine , internals@lists.php.net Message-ID: <6f7403b6-bf22-a12b-dfb2-43fe82983e7d@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties References: <20160525215208.034FC1A801B3@dd1730.kasserver.com> <5fd54aa0-4fdf-c1e7-eae8-765aa89c8498@fleshgrinder.com> <08963b03-8394-6d62-4e5b-393f3fcb5647@fleshgrinder.com> <9e9db70d-d72d-d93e-0c81-18c2aa228618@gmail.com> <409002d8-b5e3-5990-7358-246adc7e3cab@fleshgrinder.com> <57474A08.80807@lsces.co.uk> In-Reply-To: <57474A08.80807@lsces.co.uk> --LJ9b4qHVKo8NUdOad087sT3Mw06vIuf41 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/26/2016 9:10 PM, Lester Caine wrote: > DateTime is probably a better example to work with than 'int' since it > already has a long pedigree of problems and clashes where many projects= > had their own interpretation and still use their own version of the > class. My problem with '\DateTime $d' is that by default it returns > 'now' rather than an 'empty/null' value in which to put the data from > the database. I can't create a 'null' version of DateTime so one has to= > have a phantom date simply to ensure you know if it has been initialize= d > with your own data later - or continue to use the older user space clas= ses. >=20 > It is handling just how the variable/property is initialized that is th= e > whole problem here and there may be very good reasons that the > initialization is later then the 'construct' be that a DateTime or an > int ... null is the correct way of indicating that 'as yet we do not > have the value of type xxx' just as it does for an untyped value, so > trying to make a special case to block it's use is simply strangling > normal usage in other cases? >=20 Could you come up with some example code of what you cannot achieve? I cannot think of a single situation that is valid and not a developer error which would be impossible with the currently discussed approach. --=20 Richard "Fleshgrinder" Fussenegger --LJ9b4qHVKo8NUdOad087sT3Mw06vIuf41-- --kfgxddCKPh33V6JLqlAv9iudFRrvt0Sgs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXR0udAAoJEOKkKcqFPVVrgN8P/RvhulwAxu6L+gQ7dTk+e2IR 0WlZlK6QaPpDlrU77COu2IO5WhsaydwGdLwfdxXoBVwrHEiaRKo/F/TrfJZc6jMc ZmcgetVlGI6w7YLPKeyqoLUvzbwkvn++BXRSYsC0/ePGnyQZvCTPaQ6FM0eqaNn0 0LKtiS8MgujX+OLRsHT0jOo05FW1f+6rSQse9N8xEimixk0efPdlM6kwTX2u2Q3S FeDRuQw2uDkb7ASrYpfYBQFdMAhO/3w5CT/S3bxpDbteUVCg3hfCWZHXb+QnnOBn YT+NcYekOD3a2jwPiax/aNEbs/C9II4vt6b9ebRMwGMzVcvUO+c45ymbMOjestzi gsBc1OygdD6UbvGlp5wPfwvBy0Pk/Ysy8eVYq6/Q5qiMQVdmQmfe9vYn2xD434Mn /vvyfs+AbC9J5CUGWA47OPWFX7BSMuH8VFbppdoHaPLdHuKudZbn+NJBNiETLymR vyyTSd6QAd5vs13SlQZNX4aoFBTR+hdV+mdxbVKGweTrgdeJAml1oSnKLOPEMNHj HosEJwhk9w+kXcO+JghV/vhcgh5sN/EFUThkMo97QZCiu/zgLgc3SHvnAlbdfgKq p9h3zRQJGRxUX3qmtL7v0maHL68dVTVWLOWXxUUCUh2spBoQ8tW6EOKaKvLxbEpC oDUW/xof4dWN17deMFx/ =GHjR -----END PGP SIGNATURE----- --kfgxddCKPh33V6JLqlAv9iudFRrvt0Sgs--