Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73980 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15162 invoked from network); 6 May 2014 14:57:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 May 2014 14:57:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.212.173 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.212.173 mail-wi0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:42064] helo=mail-wi0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/83-20698-568F8635 for ; Tue, 06 May 2014 10:57:42 -0400 Received: by mail-wi0-f173.google.com with SMTP id bs8so7449746wib.0 for ; Tue, 06 May 2014 07:57:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EudZQ0quhy7sStqaEDeBP1W6/pSlei2I2TSGh8YqiWY=; b=b4tuC3rBuKOcLvJuvEcrCrvuG8NsWitM0Esz+ftSbQ5TlTgFgaaI52+P/u6liBk9dL 21XMgrmE/IzYoHWn729pjAsYyL4Y4DLNpjFRdeLG7+ImywlCfiYnzBN0AzE7kxShJA0V nsOytP3Ci+HbjBNcpdcWJvuT0aFt5iNzAzNt+gwFzC0eyuvFQEz5frCYr2WJDrZ3Yuw7 AtEouQ3r6iIWaQFUAJUF1+MDGIkzaRn/LWXon/ApO89Hh5Lp2cPvf3BYfh8uGFSqutOh uf7PTE3bQ7xolGCgF8EiwDQfXoUgmSaBgqmtJt1kZnKm+7iFLqI07GAyJtVEwhyNnrTC N7UQ== X-Gm-Message-State: ALoCoQk1b78cL2mFgQDdtj74fC6yRej19rF5EV7nO4wD/xE1wcEODyv5EX2LDIFey57LrtvxNBAbxFWtjRsRAppjvMCX0nJmwYCoXhCpgTsKUEunOKkfsKmDYBt1/2rYRUN9eu4U6dta MIME-Version: 1.0 X-Received: by 10.194.24.194 with SMTP id w2mr33528234wjf.25.1399388258789; Tue, 06 May 2014 07:57:38 -0700 (PDT) Received: by 10.227.234.6 with HTTP; Tue, 6 May 2014 07:57:38 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 May 2014 18:57:38 +0400 Message-ID: To: Levi Morrison Cc: Tjerk Anne Meesters , Julien Pauli , PHP Internals Content-Type: multipart/alternative; boundary=047d7b450c5611844004f8bc786d Subject: Re: [PHP-DEV] Re: 5dee3c11 break From: dmitry@zend.com (Dmitry Stogov) --047d7b450c5611844004f8bc786d Content-Type: text/plain; charset=UTF-8 On Tue, May 6, 2014 at 6:50 PM, Levi Morrison wrote: > > On Tue, May 6, 2014 at 8:46 AM, Dmitry Stogov wrote: >> >> On Tue, May 6, 2014 at 5:11 PM, Levi Morrison wrote: >> >>> On Tue, May 6, 2014 at 6:43 AM, Dmitry Stogov wrote: >>> >>>> zend_std_has_dimension() doesn't know what (check_empty == 2) means. >>>> >>>> check_empty == 0 - ISSET => we don't need to call offsetGet() and relay >>>> on >>>> offsetExists() return value. >>>> check_empty == 1 - ISEMPTY => we should call offsetGet() after >>>> offsetExists(). >>>> >>>> NULL values should be handled by offsetExists(). >>>> >>> >>> I am a bit curious, `isset` checks that the variable exists and is not >>> null; `empty` checks that the variable exists and is not empty. Why does >>> one call `offsetGet` and not the other? Both look at the value. >>> >>> Sorry if I missed that bit of conversation. >>> >> >> yeah, no problem :) >> I also, don't talk that my opinion is completely right. >> >> I think that we make us and users more and more troubles with this messy >> behavior. >> >> Actually, you introduced new behavior (NULL check) and broke at least ZF2 >> and probably many based on it applications. >> > > That isn't any new behavior, at least it shouldn't be. `isset` does not > ONLY check existence, it checks that the value is not null; see > http://php.net/isset > I know :), but we never did it for magic handlers. In case offsetExists() ot __isset() returned "flase" we didn't try to check the value. > > It leads to crash and it'll make bad php experience. >> Then someone will report it as a security problem and we all will be >> blamed :( >> We shouldn't make existing applications crash! >> > > Agreed, but at least from what I understand the current behavior doesn't > do what it is supposed to anyway. Sometimes bugs become features but I > really don't see this as one of those. We should fix this. That's my $0.02. > I would be very glad to have it fixed. Thanks. Dmitry. --047d7b450c5611844004f8bc786d--