Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109725 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64795 invoked from network); 20 Apr 2020 18:10:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2020 18:10:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D0FA91804C7 for ; Mon, 20 Apr 2020 09:41:14 -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=-2.1 required=5.0 tests=BAYES_00,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 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-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 ; Mon, 20 Apr 2020 09:41:14 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id w145so8536379lff.3 for ; Mon, 20 Apr 2020 09:41:14 -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=SfyKApz/94m3I638mTfKHYnANkM/X5/xDQ9G04vye7k=; b=KDDuy6Jk6qrcYlHaWnWFlD8fns6rqNXtqkPcUg8P3g/TbGL0NX86I5JIBtMpSuSyq4 g9FFmd+78CnajlrDy7dMDrhVPaB53zCKT9EDfAJrETqxh5XQYuD/aiBEVY5HpNz1xOQe A/qwS7jMh7aQVmx72RGNuj44qXPKUJHppkZE0iBlbryrTDvgbliLQ9LK1qmO9Jo5wFCG CTkKTELr2of4NFv5q5UbghFinDvCDAtoWhI8pAxIbj9xuI+Ah8jfwhbXfYt1glssRpGV 7qEAFrbr9c0NpUXydGsiwWUEXlL/a52nW1uEedL/J3/xSMnLkxHGL5Qz4sIWyCmaHeDB DjQA== 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=SfyKApz/94m3I638mTfKHYnANkM/X5/xDQ9G04vye7k=; b=jXnj7LXZQpC6n7En/CVpa0wJaD6DWlCrVJ4LOsd8d/zHT3usiUzCFQmmrR+5qOGbrt MR1A2QakJapOzd8SsD7zUelRGGZhCdhWHiFNCclztk9tIf+QLc9PLCOjJQ6hs2Fab8Ub POjy6kkQzEO5NAxKH045iwMI1+8kqTipIcRTzOi0UQdHHmbD8B/RrNtsQVaNHJPcyIkl 4E6i8mNkKYwIHr+/FHw0j2Zn1o3uu31EAVbMz+skImH1GKt0D+ZGTA/k4nIKd6fhY9U2 yOXzDrck22uTLKglrS+lZYBS9TI1cWw0LqjTobVB6btm0u3rF7N7uYnXuk4SJ+edPR7p aq+A== X-Gm-Message-State: AGi0Puac9Y05NGgbOC0nK/xQvgke6Fctg5nGfpmfXR5BWlHVp5dRuGCj WStojOsfOEUDxv8Xv3z9giaMHhL9tAWBazpPvQ== X-Google-Smtp-Source: APiQypK1Ilp/8giGyZ/zYeqNJulysWiavay1G5g8egx4hn5hRz9on7E4lbgOcLvLqCDGAwH3cLQAGJd4OhJ/JlZ2lc4= X-Received: by 2002:a05:6512:3049:: with SMTP id b9mr11455644lfb.176.1587400867460; Mon, 20 Apr 2020 09:41:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 20 Apr 2020 18:40:57 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Mixed type From: guilliam.xavier@gmail.com (Guilliam Xavier) On Mon, Apr 20, 2020 at 5:17 PM Larry Garfield wrote: > > With union types and stringable already on the way, I'm not sure what other non-hypothetical use cases would still be that fugly that you'd now need to fall back to `mixed`. For instance: - the parameter of [a wrapper around] gettype() or an is_* function - the return of [a generic implementation of] ArrayAccess::offsetGet() or Iterator::current(), or of a userland array_value_first() or array_value_last() function To me, especially the return type declaration can be useful to ensure that [every code path of] the implementation returns a value. -- Guilliam Xavier