Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118760 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70077 invoked from network); 5 Oct 2022 19:55:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Oct 2022 19:55:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1F32B1804C4 for ; Wed, 5 Oct 2022 12:55:50 -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.6 required=5.0 tests=BAYES_50,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-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 5 Oct 2022 12:55:49 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id j16so15499209wrh.5 for ; Wed, 05 Oct 2022 12:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date; bh=HgrJEGJZ6IhJz8jnkB7PExARLSCzO1ydzQaV9Jxyhls=; b=qKYpJv9gPO7l+AvVHCKmktskrlGjeVJGqjaloC9gSBgbWYe29agHtW033R7FYTKEee 3LruIYHpvenv5OqopANMyMfJqbb3X2LZrESIn0VDCMtD7fDa5+Rycr6m9W52wunLc+Ul JIaUqRuP9SI17UcnKKKfhRq5XNeX6EEGGJwdy4X0Jv8dWmet9If3aktI/qvSNnNPszbF 6M0ZnzXsEzE7Ro52QVkRP4AG9Z8duVyOHE1HN4dp6f7E9Gr7rhQd5G/0e6AkZYEGi7Eu jk14QCpItn+QK0DeAA/M1gzZzVSh4x3Plp5f/3wVrgiuJKic7bfum+bb4zLJhs0dqfxI eOng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date; bh=HgrJEGJZ6IhJz8jnkB7PExARLSCzO1ydzQaV9Jxyhls=; b=Id7t7s0fpoGa/MVaZV22cBn4NgDi/QBmFwRY3DgJm+2u213PejocI+dCL0QEvLEfMq aSrIFNpseeGI169SZffdkp6FvMsh5je9WTKi0v8a6KdhFF5DRF5ZbV/8zlEjIP3G5GL4 +p2HEAJD5aBBILVRI+1pEU7S1AwvVI3HPwoSdjesxjTl7Go2YIR4RMBuVg5HxnDMLBBC MHF0TDxys9bNAuvPa1ZK2uWE3KMe2OumaZaF0s+qFGiCdno24dMnIkWXk5Rjx4qwU1cu P6XCuzi+pRHmH4uRs+0soPNgDEXPx56W071Zb4jQ7XSkOR77azu/GFth9eloAgRLzzjs BpYw== X-Gm-Message-State: ACrzQf2kczzsth8i16lIVM0kO1hEWjV9CSB+wzc+avx/bujrUFyhMUtu KP9pYW42lrA5MU5I7suU2tWs2a1xfmU= X-Google-Smtp-Source: AMsMyM6Wu4Qbuxr5ROosDo2bKTSX4ButapNQK6TaixZWXaLPydnckiXZBO9Mg8clWbkmQJ8sfhXLVg== X-Received: by 2002:a05:6000:1568:b0:22e:6691:57aa with SMTP id 8-20020a056000156800b0022e669157aamr784997wrz.708.1664999748401; Wed, 05 Oct 2022 12:55:48 -0700 (PDT) Received: from [127.0.0.1] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.gmail.com with ESMTPSA id i30-20020a1c541e000000b003b486027c8asm2882153wmb.20.2022.10.05.12.55.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Oct 2022 12:55:47 -0700 (PDT) Date: Wed, 05 Oct 2022 19:00:56 +0100 To: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Union type casts From: rowan.collins@gmail.com (Rowan Tommins) On 5 October 2022 14:42:57 BST, juan carlos morales wrote: >Are you facing a situation where manual union type cast is needed? I can't think of any examples for full union types off the top of my head,= but nullable casts would frequently be useful, e=2Eg=2E when you have a va= lue that is either a numeric string or null, and you want an integer, but f= or null to stay null, not become zero=2E There's also a slightly different case, where you want values which aren't= numeric to also become null=2E As I commented on another thread, this is a= space I've been thinking about recently, and it gets complicated quickly= =2E Regards, --=20 Rowan Tommins [IMSoP]