Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120834 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43157 invoked from network); 18 Jul 2023 13:05:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jul 2023 13:05:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EA70E1804BE for ; Tue, 18 Jul 2023 06:05:26 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 18 Jul 2023 06:05:26 -0700 (PDT) Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-345d6dc271dso30243395ab.0 for ; Tue, 18 Jul 2023 06:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689685525; x=1690290325; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7YUGg1MxynGL4Xw/iS6ocTAj78rKuq9I3EFMkzMBrJ0=; b=plbeJO/LOn7JvirfFZTfShLCZBYHA5BzOkMAb68inAMqRGYYdLk+Yxq9g655g71FR6 K+EhskA0I4OvJIxHJizE8vEPWGjHf/d8qpfViYGpCxIoWpkxOCSiD2PIOfsy1e+e6BD8 lXiamds1djLdEG21RHnaHBcnQ9EcTVfJZd2dFBamhtz9AbLF0uSVmpdw3ddjX+cpwg+H Ocno0yQmQF51E7UzegCPVqCD5UWYmxU2xcn9U10wjOBHf4TBF7Bzxxl3st3AVSYResWu jMogFTdOpMJ1m2s1CY7ucYJVn4w03DG3st9B6S5KQXVor9LZVLUpHo6TBSTJKQTYVAcL CyIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689685525; x=1690290325; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7YUGg1MxynGL4Xw/iS6ocTAj78rKuq9I3EFMkzMBrJ0=; b=S4LSufzBl3S4/oDbOM6pwYiuExYEYrBeYv3JQKc/FNTicUF5qQs3hXZ/zuW+Rh14qV WW56tkCf3AfOm1Kbi4V2oq0jCM9yy8zszFlJMPdMaOVTlGnYZYv97Ha3fTV5qb5OY+Sj rHAFq/gU8BzAwpPZfSrQfkNDhaQUiflRUqexoEYIj69mz06dC8is8YznNfdSgtmh7ZjQ 8cYJY20yLOBuqJ7vCQOShWvrm+GD6+GDDslm94oX9tPHKcu4WmA5+/l6gTHR0TIA1cPP 4f/y4jfGL39cHaNat9fffd8KuAe+HP4Qk5vT5+xf883xkEcaJvKmVK1UME4JcBp2DNHD rwWw== X-Gm-Message-State: ABy/qLZHqWLsgjO/giSsmS+EB9l+31aagSEOD5dqzDghjYixxfuZT8zM yKwqapUzyvrwfeiAOpUDp1yGieg8rFKY8VP+2gI= X-Google-Smtp-Source: APBJJlEBdu8fl50LFulQ8wbcI48vnF5FgXJzw/QTrkH6bnv120szyRJ5wHNqsAJFyu0lCBB3wLrkp9SMlP33YJw34eA= X-Received: by 2002:a05:6e02:168d:b0:347:6ff0:bf09 with SMTP id f13-20020a056e02168d00b003476ff0bf09mr2581248ila.32.1689685525530; Tue, 18 Jul 2023 06:05:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ad5:4204:0:b0:2e2:2af1:79d7 with HTTP; Tue, 18 Jul 2023 06:05:25 -0700 (PDT) In-Reply-To: References: <8055b366-32f1-4d2c-85d0-0cf665e6c8d3@app.fastmail.com> Date: Tue, 18 Jul 2023 15:05:25 +0200 Message-ID: To: someniatko Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] pipes, scalar objects and on? From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2023-07-18 14:48 GMT+02:00, someniatko : > I am glad this topic arose! I was also planning to write on this topic to > the internals mailing list, but have abandoned this idea, because I feel it > might be inconvenient for the real active PHP developers on the list to > receive too many emails from the people which don't actively participate in > the development itself. > > My interest in the pipe operator might seem a little non-standard - > basically what I'd really want to see is a **nullable** pipe operator! > > There is a popular library github.com/schmittjoh/php-option, which has 250 > MILLION installations. Basically what it provides is a class-wrapper of a > value of lack thereof: it's either `Some` or `None`. I'd just like to mention that the Option type comes from FP and it's not necessarily needed in PHP-land where we have flow-sensitive type checkers like Psalm (a nullable type `?int` or such is refined to just `int` after a null check). Flow-sensitive type-checking was not invented when the Option type was first created, so adding it to PHP is basically stepping back in time, from my point of view. Olle