Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88252 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23908 invoked from network); 16 Sep 2015 17:37:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2015 17:37:15 -0000 Authentication-Results: pb1.pair.com header.from=rewilliams@thesba.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rewilliams@thesba.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thesba.com designates 208.106.205.211 as permitted sender) X-PHP-List-Original-Sender: rewilliams@thesba.com X-Host-Fingerprint: 208.106.205.211 ntsexchedgea2.newtekemail.com Received: from [208.106.205.211] ([208.106.205.211:54331] helo=NTSEXCHEDGEA2.nts.phx1) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/83-04557-AC8A9F55 for ; Wed, 16 Sep 2015 13:37:15 -0400 Received: from NTSMAILBOX1.NTS.PHX1 (208.106.205.232) by NTSEXCHEDGEA2.newtekemail.com (208.106.205.211) with Microsoft SMTP Server (TLS) id 8.3.348.2; Wed, 16 Sep 2015 10:36:36 -0700 Received: from NTSMAILBOX1.NTS.PHX1 (2002:d06a:cde8::d06a:cde8) by NTSMAILBOX1.NTS.PHX1 (2002:d06a:cde8::d06a:cde8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Wed, 16 Sep 2015 10:37:10 -0700 Received: from NTSMAILBOX1.NTS.PHX1 ([fe80::51f0:160d:841f:d989]) by NTSMAILBOX1.NTS.PHX1 ([fe80::51f0:160d:841f:d989%13]) with mapi id 15.00.0847.030; Wed, 16 Sep 2015 10:37:10 -0700 To: Rowan Collins CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? Thread-Index: AQHQ36zP6Wb5e1HnokKnJlazAkejtZ4eJ62AgABxe4CAAAPLgIAAJlKAgAAUa4CAACGZAIAAGymAgAjS3QCAAJOjgIAA+D+AgAA5fACAB+afgIAB6WsAgAFo8ICAACyWAIAHac+AgAAGeYCAAD+qgIAAAnkAgABF9ACAAAG1gIAAJ92AgAAFuoCAADs0MIACTzKAgAA+UIA= Date: Wed, 16 Sep 2015 17:37:09 +0000 Message-ID: <738E9B97-6D20-4E37-85E0-994003ACDFC1@thesba.com> References: <55DDD60F.5090509@gmail.com> <8C74463E-DBA2-4015-8159-0B44D973387F@craigfrancis.co.uk> <55DE0907.6040904@gmail.com> <1F615BCD-1B9B-4C51-A210-869F1AA1F6E3@craigfrancis.co.uk> <55E5EBBF.6020803@gmail.com> <0BA3A129-D356-4781-B6DE-E2B5A7924AE2@craigfrancis.co.uk> <55E6EC36.6090301@gmail.com> <9AF329EC-99A5-412D-A52B-432627A5520F@gmail.com> <6F4D91EE-B56E-4B83-B1AF-598C3F6897FC@craigfrancis.co.uk> <55F07BA4.2000204@gmail.com> <55F6B911.9080400@gmail.com> <96BE7F01-D04B-483B-B1A3-B45CED6DFCDC@craigfrancis.co.uk> <55F6F08C.1020506@gmail.com> <0BEF6D82-CB5F-49F6-A3A4-3267924A0CDA@thesba.com> <55F72CA9.2060301@gmail.com> <09369945-76FE-4E08-9C2C-15FB0577AD27@thesba.com> <55F752E7.9070801@gmail.com> <55F9747F.4070708@gmail.com> In-Reply-To: <55F9747F.4070708@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [172.16.153.36] Content-Type: multipart/signed; boundary="Apple-Mail=_99655474-DED3-45AE-BD4D-D907F977B905"; protocol="application/pgp-signature"; micalg=pgp-sha512 MIME-Version: 1.0 Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: rewilliams@thesba.com (Robert Williams) --Apple-Mail=_99655474-DED3-45AE-BD4D-D907F977B905 Content-Type: multipart/alternative; boundary="Apple-Mail=_96239949-6CA2-4FB8-B1BC-3CA9C9FCFFE7" --Apple-Mail=_96239949-6CA2-4FB8-B1BC-3CA9C9FCFFE7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Sep 16, 2015, at 06:54, Rowan Collins = wrote: >=20 > I want to pull this out for a bit more attention: one of the crucial = questions in this thread is whether the language is wrong, or just the = documentation. There's one particularly wonky passage someone found in = the manual that makes it sound like unitialised variables have an = intrinsic type when accessed, rather than just referring the reader to = the rules on casting null to any given type; when I have time, I will = find and reword it. The docs suggest that uninitialized variables are null, and the above = makes it sound like that=92s what you=92re stating, too. But they=92re = not: they don=92t exist at all, they=92re uninitialized. If they were = null, then PHP wouldn=92t spit out errors about undefined variable = accesses because it would see them as the same thing as a (perfectly = legal) null variable access. Differentiating these various cases is = currently a little wonky, requiring some extra boilerplate code and/or = ugly-ish workarounds (like calling get_defined_vars()). I don=92t think = it=92s a huge gap in the language, but it=92s a definite gap, and it=92s = one that many less-experienced programmers fall right into with safety = checks. -Bob --Apple-Mail=_96239949-6CA2-4FB8-B1BC-3CA9C9FCFFE7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
On Sep 16, 2015, at 06:54, Rowan Collins = <rowan.collins@gmail.com> wrote:

I want to pull this out = for a bit more attention: one of the crucial questions in this thread is = whether the language is wrong, or just the documentation. There's one = particularly wonky passage someone found in the manual that makes it = sound like unitialised variables have an intrinsic type when accessed, = rather than just referring the reader to the rules on casting null to = any given type; when I have time, I will find and reword it.

The docs suggest that uninitialized = variables are null, and the above makes it sound like that=92s what = you=92re stating, too. But they=92re not: they don=92t exist at all, = they=92re uninitialized. If they were null, then PHP wouldn=92t spit out = errors about undefined variable accesses because it would see them as = the same thing as a (perfectly legal) null variable access. = Differentiating these various cases is currently a little wonky, = requiring some extra boilerplate code and/or ugly-ish workarounds (like = calling get_defined_vars()). I don=92t think it=92s a huge gap in the = language, but it=92s a definite gap, and it=92s one that many = less-experienced programmers fall right into with safety = checks.

-Bob
= --Apple-Mail=_96239949-6CA2-4FB8-B1BC-3CA9C9FCFFE7-- --Apple-Mail=_99655474-DED3-45AE-BD4D-D907F977B905 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJV+ajEAAoJEFBTSdRZ0ub3+2EP/29eknKFy2GiQ7c2YAzCau+8 B0AsagXiZf9GvFOGDkdPChKZPZqErkbPZiYWUKrBATxzz5wcyiRQkJDU0157rnm+ ByaFh1fwClsP/oqIZMypISr1vUMf99deT4DJZo2WAna4TDCzjtDHWE3BLYLQRuYu 6nIWCeB831doVbCyWTkaI9cHl/9IbO9a8LAYZvtv61GQbvZMjuIMjOzQX0CoSCqw rApndNdOqWkL8qM1jG3XIsMnlFH/o6ls2JGGrSlDyzqR6wkqhojDHPiilEtwpiIe yYLAmMisgwFdOGNhhYU1J4A2QBVoCAdCaYSNHl8GUU5PCBDrbswhpmuIrL4T0KoN 0AZG67GgLStke+7SN/N1Vm69/XRntxp9ebXHVEkIo/sYNhh4OibpuZfIn+vsU5B4 jdsl1//R3A4Q2jcTsATZDYDM8gv9JKe1STmNasLOSs+gSgA4EQt63hL828qYHacg uEwcWz5F1aD69WA6We9PCR/UuyTIhBnJScpfZtDIMjl7a4LV9B32TbHdfkoioOmk bEwMfUbZ1c/X8b1hlb4LKwjLhFtYs6pIPhmEJfjS7PktJmaP370ZjHB+rBqOnQHD U9wqQP+krjK+bddSTiTRXTNnZDBiluhWEJmbMFnW+0R6Za6C2Db0XfGX56Wp+OMu RjTlUL6WL+IOYWRcWufb =pGXT -----END PGP SIGNATURE----- --Apple-Mail=_99655474-DED3-45AE-BD4D-D907F977B905--