Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111062 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17734 invoked from network); 17 Jul 2020 10:22:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jul 2020 10:22:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 65045180509 for ; Fri, 17 Jul 2020 02:16:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 17 Jul 2020 02:16:00 -0700 (PDT) Received: by mail-vk1-f174.google.com with SMTP id 66so1954270vka.13 for ; Fri, 17 Jul 2020 02:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pHFcmN/XWpIx+E6RBy3X+UF3r7omoy1APryINKBynEk=; b=RaozuoBPjFrDzwVWPjGlA4jWp7XzRa9ZEl7Vq8YTH2pUiQXlt4EZazAHbX2GZEWF0M syTzyZdM5i0I2gMeupjcnwA2EAGxak7ep7LmFp1Rs6b3BbP3z40oFAguVPLj4L5EfqYf DUBc4GM/kowJWZIM1Tv56p1cuSYszzKZ1AdVmMmUHYYCaXYzhJgnQHb1JPL8DCPZCp/l h+4DV6v3iuYllyEZmU8wAZvXMDzwb/yC8joLRO+T2fj1zyPF0SAuTMRf0JS8SqMQGw4I yTHAS4GYFfgeMMk5kXmigeqB4X0SS+S1ZQ9S+ATM+EUyFQ3fzdGpDkJqIsKXVtoy+W95 Y5Wg== 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=pHFcmN/XWpIx+E6RBy3X+UF3r7omoy1APryINKBynEk=; b=U+3WlX7AEl1d7TAkVegI333f+N5k5+8ixA3Q0OrYlkeLaY9++ZhbfG4QR2V5QFr+bS pR0TLdkg9Lvj+xDZKUT3LTId1TSUkpP77nVWJJysAaqZmVVvvBMH4hyTeOcoRoHIVIGz eLokj5NYTqzZiBvmgYEL27mRvNzD+8USR/ZUMVsWyYeFhHUPcrT8B7G8dz5Abksh29rM mqUg/3TKkZPdB62kv9acGx3pna2pO+3n0Prh9MfVeAvQ7eht/985z/+71SyqBIWudKSm r8s8t3sin2zfUclvK+UObqO1aUU0QKZwJlR9R+Mq+uj/C6g1MJ0f8d4kz5hxawSlCp9E zy3g== X-Gm-Message-State: AOAM531lxFR2X8wBlQVQ5hDVoVfx8Ss+HV/hTMgpc0k0UDovjDBI9UGC V10K+NB97kBwfhzy4xlk71n9OduNW4nNxxwH8IdHiA== X-Google-Smtp-Source: ABdhPJwnGI4JaSVCaNWy54QLC/XGiyqa9mroX6PIhFtlIbDC+XFlgb/Bz8xRErSQciJi7fMGcE1i5uaXoMiEmz4H0Dg= X-Received: by 2002:a1f:5ec9:: with SMTP id s192mr6204099vkb.97.1594977359006; Fri, 17 Jul 2020 02:15:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jul 2020 10:15:48 +0100 Message-ID: To: Ilija Tovilo Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [VOTE] nullsafe operator RFC From: Danack@basereality.com (Dan Ackroyd) On Fri, 17 Jul 2020 at 10:05, Ilija Tovilo wrote: > > Hi internals > > I started the vote on the nullsafe operator RFC. > https://wiki.php.net/rfc/nullsafe_operator > > The vote closes on 2020-07-31. I'm voting yes. From the discussions I've seen, there are two overlapping reasons people have said for why they don't like this proposal. "checking that the value is null should be a red flag that something is wrong with the data model." Even if there is something wrong with the data model, programmers are often in a position where they can't change the data model. That can be because it's part of an api/library that's provided by a 3rd party, or is part of a legacy code base that can't be refactored right now. PHP exists to be useful. Adding a small feature that makes it easier to work with some data models is a useful thing to do. But also, sometimes the data just is null. Whether you use a null type, a type union, Option, a Nothing-type or whatever, it's got to be handled somewhere. This RFC provides a way of handling it in a way that is very easy to write and read, imo. I realise that some people would prefer to not use this syntax in their own code, which is fine. But as it makes coding easier for other people, I hope people would only vote no for a stronger reason than they would personally prefer not to use it. cheers Dan Ack