Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106951 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11849 invoked from network); 12 Sep 2019 16:32:02 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 16:32:02 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id DC22E2C8725 for ; Thu, 12 Sep 2019 07:07:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FREEMAIL_REPLY, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 12 Sep 2019 07:07:55 -0700 (PDT) Received: by mail-vs1-xe2c.google.com with SMTP id u21so16239663vsl.10 for ; Thu, 12 Sep 2019 07:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=czwlh1DeEWu52Cphc4MAaGoAHmltdpfW7ajKvrlvuYE=; b=a6MXwQUeBtj4lPCk9ppVWKV0m9wi4bHktRyTSkhGOyz6Oyl1rR6NS8c+uI7NDejCV1 wUcgSJK+8kEjZm3dJeUGEpmH1CTbdWS2z6VHQrqWOw5tKoc7EcHo1gLzyN/jl6519MY4 jUxeab3mC5W7j8n8yX24BzqUp3uCvb/00eGKCYThcWweBP+l4GXb5JAETSNWGSaEf9ft FDtKUTJyrAZG6ELx/KIJWjOagYsOnue2kBevNX6YnTwx8a+QW5pTkjpoZFVoK+4eRozm H8tzevQGN8fgmYVcz7y3nX7wIH4pdOk+p8iM9TPJv4lKcQBoQcdf0hl6vQqw7+gFaJq7 sFig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=czwlh1DeEWu52Cphc4MAaGoAHmltdpfW7ajKvrlvuYE=; b=MEGlyHJz6iKelLwAmmONRWjC//nnGNMqvJPGvxu5bK2Yyy4D4YiXg8JKFuHTs2tTdQ DcoyeqdsIwDPF9daaGHCGs69qbc/LjjuTMCx6NJIB0VGGpS4CfTejcDJDO+FPcAPmO6T xJ9zzqpjciZ6GcBKNSN/iH7DXt6upXUGvtkWDGiOGsgXOij2MpzzJivBg6F+d9tu/2gH satj15EVG3gOXcFpTLutW8SRkEbWSV0VR7e3R5Pl40c5sKA//9Lp59xKoS3Ubdjr33Oh U1RhRXWrL+YxYA6YI3aBRcHv2kL1DMDs6xfP4RylcRpkWwjSI5w/a+//lPqbk8Gpm4JZ 0leQ== X-Gm-Message-State: APjAAAXlYNlefE63NBWfLzPQy6eBGR/BgXVLgM0DLBraZNwaOI/3AFyb u9M6IJKgt+VX2yGf13ADx+vuG9AICD1D4WeKQYo= X-Google-Smtp-Source: APXvYqx+CryKbfg9TSYREHN6WrePnxyqC3yAAwgrC+WALwZ+qtowleN7TBc9yKSRVhJpmGwFpfyqrYh2yfJ5STAoIOw= X-Received: by 2002:a67:f9c8:: with SMTP id c8mr547019vsq.126.1568297275375; Thu, 12 Sep 2019 07:07:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 12 Sep 2019 10:07:44 -0400 Message-ID: To: Arvids Godjuks Cc: Marco Pivetta , Rowan Tommins , PHP internals Content-Type: multipart/alternative; boundary="0000000000000043d405925baa5d" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: chasepeeler@gmail.com (Chase Peeler) --0000000000000043d405925baa5d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 12, 2019 at 10:02 AM Arvids Godjuks wrote: > =D1=87=D1=82, 12 =D1=81=D0=B5=D0=BD=D1=82. 2019 =D0=B3. =D0=B2 15:33, Mar= co Pivetta : > > > Hey Rowan, > > > > > > > > On Thu, Sep 12, 2019 at 3:30 PM Rowan Tommins > > wrote: > > > > > For instance, for undefined array keys, what if we had an operator fo= r > > > "initialise and retrieve", such as $foo[? 'bar']. Then we could > simplify > > > ugly code like this: > > > > > > if ( ! isset($foo[$key1]) { > > > $foo[$key1] =3D []; > > > } > > > if ( ! isset($foo[$key1][$key2]) { > > > $foo[$key1][$key2] =3D 0; > > > } > > > $foo[$key1][$key2]++; > > > > > > > > > With something safe but succinct like this: > > > > > > $foo[? $key1][? $key2]++; > > > > > > > $foo[$key1][$key2] =3D ($foo[$key1][$key2] ?? 0) + 1; > > > > Marco Pivetta > > > > http://twitter.com/Ocramius > > > > http://ocramius.github.com/ > > > > This message contains a healthy dose of sarcasm. > > Hi Marko and Rowan :) > > *Me reviewing the PR with that code* > *Clicks "Changes required" > [ Please rewrite this statement into easy readable format with an if ] > * Clicks send * > > Think what you must, but 6 months when you come back to code like this yo= u > have to stop, look at it hard and figure out what the hell actually happe= ns > there. > Breaks reading flow. > > One thing I like PHP for is a distinct lack of huge amounts of syntax > sugar. > Take Ruby - it's a hell to read the code. Even Vagrantfile has tons of > results about what syntax for arrays to use and things breaking because y= ou > end up mixing stuff and you get at least 4 different answers to the same > question and it looks like all are correct. Confusing as hell :) > > What I'm trying to say is some of us choose PHP for it's "there is one > syntax - use it". If people want syntax sugar - there are other languages > that fit that much better. Leave us, peasants, in our peasant non-syntax > sugar world alone :D > > Exactly. One common theme I've been seeing is "We already force our developers to initialize variables, so, whats the big deal if you have to?" or "We already force a no-notice environment, so what's the big deal if you have to?" If you're already doing it, then why do you feel the need to force others to? You've proven that it can be done in the current system. I'm making my prediction now - if this RFC passes, the adoption rate for PHP 8 is going to be HORRIBLE. > But many of us would also like the language engine to tighten up some of > its extremely relaxed parts that do not fit in modern development > environments and the lowest bar of the code quality rise a bit. Otherwise= , > the gap between high-end development and newbies is going to be even bigg= er > than it is now. > I hire people, that's part of my job. One of the criteria is the approach > to errors/warning/notices. Imagine how that goes. > > -- > Arv=C4=ABds Godjuks > > +371 26 851 664 > arvids.godjuks@gmail.com > Skype: psihius > Telegram: @psihius https://t.me/psihius > --=20 Chase Peeler chasepeeler@gmail.com --0000000000000043d405925baa5d--