Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106949 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8005 invoked from network); 12 Sep 2019 16:26:37 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 16:26:37 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 331DC2D1FD0 for ; Thu, 12 Sep 2019 07:02:32 -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,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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:02:31 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id t16so28605167wra.6 for ; Thu, 12 Sep 2019 07:02:31 -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=Myi+9sjYZbcrQaeLxMiPw9buDHBwaERHnfPHnmgzFbc=; b=hfbBgnacO007qH5l8LDmdBkWyNjqLMegJ8Nfyi5RfI0NvqGLgSb8H6IIOnwvfO33BI kTDXZr0V9Na2HJBBefka+hMzC72WXx4Q1rvyVVREyFzKity2kcz6zNMM+oFQmAkvN+vl 94rrwHGcp2XTjElTOgFt+aGuWEhFzxbzNCLdoYaEs6qA0fR03NIQQZnflqb8zMCLLMIg f5qWjTrwLudR0onoIhnx51r0zKgzL7e9ATPfYGTlFKPn69BGDDFGXWUIxvrLgLZ6ygP0 VIiiL92bW0LEBeXils7iDHyojEVX+jdzaFjVcuT5g+7OU/UX3jKg/hG79gTbuLAeeKo/ CQAg== 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=Myi+9sjYZbcrQaeLxMiPw9buDHBwaERHnfPHnmgzFbc=; b=cihajVN5/TWUIsSUkqLqYWxBBmkeINkUfD2ZkWe/OEOB35xNzhJWQ3lhV3RZ5gKaVa Ixre4z2GMxnImaBHCcJfFCil6PYPqKsgGvySpVkUFDdjT6SfhSqa3RGO9oBxo+W0DY/C AugiEhIle9X+KfbcOcsK4Ytn6kk2COa9ywuivb5ABCuxRgC0y9KUKDCtozVWO3vTxn5h gDGdS7BWb/XB6FjW1eoX2NdyC+Ef3WE0ilRqDIyUgWhFEhYXZ0uM8FDMJv9j/tB254vm Yo+CSE/Uslhf/nl/WTu+HTr7JUdxWfRono5QoV6CnBSyYhv28PsFRQx6+yBMxJ/eU296 HmqA== X-Gm-Message-State: APjAAAVoqLKTBpIWvoBQKNcVbgaCmEfjkkYZ39bNV0nQ3mz32NVCcSgu +m56QLzpGvw7V1F32LjubASS7cdwF36po+FzpKw= X-Google-Smtp-Source: APXvYqyspQNM0dik9P2iDDB8DIzJBVJGDfTdCFv8m4dNGKn1TrqbPiqmhwuhwygnncYNtWYdJOFrmA/BT/4J7XctrDo= X-Received: by 2002:adf:dbc6:: with SMTP id e6mr1555605wrj.149.1568296950523; Thu, 12 Sep 2019 07:02:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 12 Sep 2019 16:02:03 +0200 Message-ID: To: Marco Pivetta Cc: Rowan Tommins , PHP internals Content-Type: multipart/alternative; boundary="000000000000a36df405925b96b3" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: arvids.godjuks@gmail.com (Arvids Godjuks) --000000000000a36df405925b96b3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =D1=87=D1=82, 12 =D1=81=D0=B5=D0=BD=D1=82. 2019 =D0=B3. =D0=B2 15:33, Marco= 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 for > > "initialise and retrieve", such as $foo[? 'bar']. Then we could simplif= y > > 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 you have to stop, look at it hard and figure out what the hell actually happens 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 you 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 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 bigger 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. --=20 Arv=C4=ABds Godjuks +371 26 851 664 arvids.godjuks@gmail.com Skype: psihius Telegram: @psihius https://t.me/psihius --000000000000a36df405925b96b3--