Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106715 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36453 invoked from network); 28 Aug 2019 13:08:55 -0000 Received: from unknown (HELO tbjjbihbhebb.turbo-smtp.net) (199.187.174.11) by pb1.pair.com with SMTP; 28 Aug 2019 13:08:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.net; s=turbo-smtp; x=1567593663; h=DomainKey-Signature:Received: Received:MIME-Version:References:In-Reply-To:From:Date: Message-ID:Subject:To:Cc:Content-Type; bh=EFbt48qIJzhw6vt0+cerxI IVBlU0nNGWlTixtt1VP9E=; b=rV1GUmKU32IVIHZeM6vSeu1PoV2aKYePUotBEs b/WvCMDqh8sfGPX7QIhWhdxOJD9Z8tFWFH7zK/iCg39F8M0xQPSIHvbIS8+syGEr 9Yv9sfsj6pSZgo/1XwUGp6qGDVnpbykR8CeB7OeHSx/iv72cCVONpp9ZPRhvHczw r9sEY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=turbo-smtp; d=php.net; h=Received:Received:X-TurboSMTP-Tracking:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version:References:In-Reply-To:From:Date:X-Gmail-Original-Message-Id:Message-ID:Subject:To:Cc:Content-Type; b=iIOtlw2oWNHUP17FE0/uHHsyvh5s12HgXIjZgUyuPHehqLCmj474Z2wBPJanFm H8SoxvcxBAtgjhUb+DkfYz1txcHyd4uIgbZAUrNur3keNSfgUO5Nmu6tbPu1IpZF HPbbwVJHsJEnjw/nLrpeZDpdoeD3txOXqE9AhlW8sDPHk=; Received: (qmail 7805 invoked from network); 28 Aug 2019 10:41:02 -0000 Received: X-TurboSMTP-Tracking: 5244584232 X-Gm-Message-State: APjAAAVDsPlw1cK7G+S//YEChYh1paeaZrVU2U+w5VRe49BeH4DMW00f C4Fg4ELqrpqP1/DA2h/W/9rz7qc0vd0qKcBpAD0= X-Google-Smtp-Source: APXvYqzGpkyo9nUqJyWseB2xcXjw9NrBmoLiAdkdgppFlT1PbSAxbXV8cTHiLjFq60bekMAzPJ+I1ZnQgeGngt+zp94= X-Received: by 2002:ac8:281c:: with SMTP id 28mr3474865qtq.102.1566988862142; Wed, 28 Aug 2019 03:41:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 28 Aug 2019 13:40:47 +0300 X-Gmail-Original-Message-Id: Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007ebf6205912b0667" Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: zeev@php.net (Zeev Suraski) --0000000000007ebf6205912b0667 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 28, 2019 at 12:33 PM Nikita Popov wrote: > Hi internals, > > I think it's time to take a look at our existing warnings & notices in the > engine, and think about whether their current classification is still > appropriate. Error conditions like "undefined variable" only generating a > notice is really quite mind-boggling. > > I've prepared an RFC with some suggested classifications, though there's > room for bikeshedding here... > > https://wiki.php.net/rfc/engine_warnings Specifically on undefined variables, the way we deal with them has little to do with register_globals. It's behavior you can find in other dynamic languages (e.g. Perl), and allows for certain code patterns (which rely on the automatic creation of a variable whenever it's used in write context, and on a default known-in-advance value in case it's used in a read context). It's fine not to like this behavior or the code patterns that commonly rely on it (e.g., @$foo++), but it's intentional and isn't related to any historical reasons. I think many (if not all) of your proposals make sense, but most of them make sense as an opt-in - perhaps using something similar to Perl's strict mode (which incidentally, changes the way the language treats undefined variables in exactly the same way). This would also provide a future-proof solution for additional similarly-themed proposals (such as strict ops, etc.). Zeev --0000000000007ebf6205912b0667--