Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88243 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94631 invoked from network); 16 Sep 2015 14:02:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2015 14:02:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.180 mail-wi0-f180.google.com Received: from [209.85.212.180] ([209.85.212.180:34464] helo=mail-wi0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/3C-30198-D6679F55 for ; Wed, 16 Sep 2015 10:02:22 -0400 Received: by wicfx3 with SMTP id fx3so74719024wic.1 for ; Wed, 16 Sep 2015 07:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=iNhTea347I0p88SJBt3ymBmlTtxAYeskcaN6zP+KhmY=; b=gHMQ+oYk+SROc9xXqiLZAMMpuzjUZHqLLGpqBksrAbYnbbp61L31q716t2CMkCZlp1 cYem76zT2vjphZqp9SCP2la/cZpQ2eblnRYGtw9FkWAuRkAxr+OR4Ky6tU/g/wee1bZn kCBnd892kgWHPuIuEvpLvvkPq3zARAsl2D548x1W38UEFxMLAqpp6GvMaqUHPO7n9AYZ 1TiA4rlzwxxNDbkj+SyQCEylH8Nm5yQ4vCc+tlQLwRf5Xol5OUHIiJVzRgh+PNJ4RgpA ICeoRZry/W6Au6d2A8pNmvtSxQYm1SvZEYz7ZaMiUHogQGCVhbNWvjRFDiRtlKC7Qdlc 6/ag== X-Received: by 10.194.174.201 with SMTP id bu9mr24246828wjc.73.1442412138610; Wed, 16 Sep 2015 07:02:18 -0700 (PDT) Received: from [192.168.0.127] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id jw9sm26765415wjb.28.2015.09.16.07.02.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 07:02:18 -0700 (PDT) To: internals@lists.php.net 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> Message-ID: <55F97639.8010802@gmail.com> Date: Wed, 16 Sep 2015 15:01:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: rowan.collins@gmail.com (Rowan Collins) Robert Williams wrote on 15/09/2015 10:38: > Okay, so to bring this home: > > 1 PHP defines null to include variables that have "not been set" > 2 PHP also defines null to include variables that have been unset() > 3 Variables can be explicitly set to null > > All of these are null. And yet: > > 4 Calling isset(), which is documented to return true on null, on 1, 2, and 3 will only return true for 3. > > How's this consistent? What you've just described there is the functionality some people want to add. Currently, isset() will return false for all three cases, precisely because they are treated as equivalent. So you've actually neatly demonstrated why it is consistent for isset() to behave as it does. > IMHO, PHP went south in its design when it tried to declare undefined variables as null. They're not; they're undefined. Beyond isset/empty/is_null, however, the rest of PHP seems to accept this. "The rest of PHP" makes no such distinction. If you evaluate "$b = $a + 1" when $a is not defined, PHP behaves exactly as if you had written "$a=null; $b = (int)$a + 1;", but the runtime will issue a notice (not, as you keep claiming, an error) that you forgot to write the "$a=null" part and might want to add it in or check if you've mistyped the variable name. Regards, -- Rowan Collins [IMSoP]