Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88277 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87853 invoked from network); 17 Sep 2015 01:18:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2015 01:18:05 -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:59353] helo=NTSEXCHEDGEA2.nts.phx1) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/C8-41443-CC41AF55 for ; Wed, 16 Sep 2015 21:18:05 -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 18:17:24 -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 18:18:00 -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 18:18:00 -0700 To: Stanislav Malyshev CC: internals Thread-Topic: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? Thread-Index: AQHQ36zP6Wb5e1HnokKnJlazAkejtZ4eJ62AgABxe4CAAAPLgIAAJlKAgAAUa4CAACGZAIAAGymAgAjS3QCAAJOjgIAA+D+AgAA5fACAB+afgIAB6WsAgAFo8ICAACyWAIAHac+AgAAGeYCAAD+qgIAAAnkAgABF9ACAAAG1gIAAJ92AgAAFuoCAADs0MIACm9OAgAAanQCAAB/zgIAAN+GA Date: Thu, 17 Sep 2015 01:17:59 +0000 Message-ID: <711C7F58-6187-4ED2-8314-EB217DF0EC2B@thesba.com> References: <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> <55F9B4C7.3050700@gmail.com> <440C64A2-4B4F-4AEF-ACE3-F3A6637EBAB6@thesba.com> <55F9E5E7.3030408@gmail.com> In-Reply-To: <55F9E5E7.3030408@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=_866EB3BA-34E3-4645-A177-40FAD5CEE36D"; 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=_866EB3BA-34E3-4645-A177-40FAD5CEE36D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Sep 16, 2015, at 14:57, Stanislav Malyshev = wrote: >=20 >> I=92ll refer again to the above documentation: >>=20 >> "A variable is considered to be null if [=85] it has been unset().=94 >=20 > You are confusing two things. >=20 > 1. The variable has value of null. > 2. The variable does not exist, so when you try to get its value, > there's nothing to give you, but we don't want to produce fatal error > because of such trifle, so we substitute null instead. Nothing confused here. If the variable doesn=92t exist, then it doesn=92t = exist, and accessing it rightly produces an error (albeit a low-grade = error). PHP gives you a token null to be nice, but the fact is, you = still committed an error by trying to access something that doesn=92t = exist. I=92m fine with all of that, but I also would like to have the = option of easily knowing about the problem before I hit it. And, although you may not care whether the provenance of a variable=92s = null lies in buggy code or in explicit programmer/user decision, I = consider that an extremely important distinction. It=92s the difference = between, =93What the hell, delete anyway. They can always do the work = again.=94 and, =93Okay, we=92ve got a signed delete order from the user, = so delete away." >> This one can=92t be chalked up to sloppy writing. Here, something is = just >> plain wrong. >=20 > I'm afraid the something which is wrong here is your understanding of > how undefined variables and nulls work :) "Considered to" is not the > same as "is". It's a substitution, not identity. I understand it just fine, thank you, but I disagree with your = forgiveness of the docs. An unset variable is not null. Rather, it=92s = completely undefined, and PHP yells at you for just that reason if you = try to access it. Then, it turns around and tries to appease you by = giving you null. If it changed it to null on access and never threw the = error, your statement would be more accurate, but that=92s not what = happens. For the record, I=92d actually prefer that PHP throw a fatal error if = you access an undefined variable because it almost always means that = your code is working with junk data. Right along with that, however, I=92d= like a way to easily tell that my data is bad (i.e., a variable hasn=92t = been defined) so that I can gracefully handle the problem and avoid the = fatal. -Bob --Apple-Mail=_866EB3BA-34E3-4645-A177-40FAD5CEE36D 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+hTHAAoJEFBTSdRZ0ub3OOsP/isDEyJbuij/zCKVxI8OEZCL D61VYlVmeVi3XQpGffUfQjLHQPVnxl7d759xzdtGTwkVrGEd03Nqcki9lQbrOazG 9uY+U6HftC8zth+x96+00EEzvoXcSwVlZWUEDsBv32Qm0C3dud0i4d91u5GzKj+M 1KsZe3mirVWhfMdLfw+FKqm1nqdDgx/4dI1ks3nvPeBLnVSJxm0apgylLWWTcBX0 PY0Qv6Ro+M99ioP7tadXMxtV2CDSJyn18ZfLD1JQCNfCmiNJGXrcVpqbcBsfkhTC EjaUAlkFE2w/BpMXFhBP5aXLG3C5utXSp+B9/VrwniMZnSfCAf2RGNa5HWs+SklN uv33pfnheYbqLjt5P9FZCWXiG/0i95HUODe5AaPPZwgG98kyqFuPz7nBbDoLaO3H 1nBVJWa5tD0ywwXi6zj8ajUa7eEPmMgXNA4mK7MfGrdn0paJnMcGLKoentmZTP0J o3dPewVfxkFe6tzKsc2H5Q+X//85y+kafLI9rFFK5CrDbzKLcKeQx4fgFHwfgbak fFJVtxetnXDtmlyaEOiOLaxCCQM6UAMttnrONY9EeBSNu+pqi1jbuIlGwPnYAoLK BYD5qyp1/H5bvGp0H5SAckOakYBw6KpE8WHkyYrlNPtNmNQyhn2HTjUirpNw+KbA +uvexDR0EYThQswp6qHD =2jdA -----END PGP SIGNATURE----- --Apple-Mail=_866EB3BA-34E3-4645-A177-40FAD5CEE36D--