Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106806 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37657 invoked from network); 29 Aug 2019 19:52:04 -0000 Received: from unknown (HELO mail.gna.ch) (62.12.172.119) by pb1.pair.com with SMTP; 29 Aug 2019 19:52:04 -0000 Received: from [10.0.1.55] (77-56-180-37.dclient.hispeed.ch [77.56.180.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id B9F6920A3A; Thu, 29 Aug 2019 19:24:30 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) In-Reply-To: <94054653-020b-78bb-9208-d0533b85be72@aegir.sexy> Date: Thu, 29 Aug 2019 19:24:29 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <33b4068a-3b32-4904-a033-4ff3f28e1161@aegir.sexy> <1EDD1FE6-9AB8-4CDF-8EE4-416C18390725@gmail.com> <94054653-020b-78bb-9208-d0533b85be72@aegir.sexy> To: Aegir Leet X-Mailer: Apple Mail (2.3445.104.11) Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: cschneid@cschneid.com (Christian Schneider) Am 29.08.2019 um 18:25 schrieb Aegir Leet : > Before reading the responses to this thread, I had honestly never > encountered a PHP developer who thought using uninitialized variables > was fine. Now you have. Nice to meet you. > I knew it worked, but I always considered this to basically be > the PHP equivalent of undefined behavior in C. And I don't think = anyone > would get mad if a new GCC version broke the way they were abusing UB. That's where you are mixing things up: It is well-defined behaviour, = even if you personally don't like it. A better analogy is static variables in C. It is common (and not = considered bad) practice to not explicitly set a variable to 0 as that = is the default value. Example: = https://github.com/git/git/blob/6d5b26420848ec3bc7eae46a7ffa54f20276249d/d= elta-islands.c#L26 - Chris