Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109726 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67591 invoked from network); 20 Apr 2020 18:22:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2020 18:22:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BEDF41804C2 for ; Mon, 20 Apr 2020 09:53:15 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,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-ua1-f47.google.com (mail-ua1-f47.google.com [209.85.222.47]) (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:53:15 -0700 (PDT) Received: by mail-ua1-f47.google.com with SMTP id g10so3913850uae.5 for ; Mon, 20 Apr 2020 09:53:15 -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=1l8Dnw+mtkKkPPH4zQ9vl8x5ALOq5a8O6EsX0jTIeJk=; b=dXHRkKTTuNY4nGekoWqzY6Mu7P/A3AZlF47YQwWTRmy3RmP+GAJ4k/qc6sTeBWseKa 8xy9I7WxuLBWD8rl9rK/fpRsxseeOvlW/y5bXCtSZmBPIxlPB6k0tTb9CbJLNp6Qmy6o gx6T4CTVarDv8hNy5L/e03TY77I7DBJ6rkpxy4TfvB3n/HVDIeWRBy9F5M3eTG0Glzbz bZz73fTlch/1B523VycE2Sj/UUWQUMQBWLkcng3GGFHdKNG1gXV632g+CNEB5Vg/nUDc 9nX/F2B0gZhF6qjuHWGyvUg2bR4emndGUYTKoeR+8ZFEeWl9StidoaSRjrft7yI3X0RL 5vxw== 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=1l8Dnw+mtkKkPPH4zQ9vl8x5ALOq5a8O6EsX0jTIeJk=; b=r/jRmou3PFiIb7D50JvLms1M4KGavr7SFAzAIgPBuy+GETjH2RSFUOzpRvkhpAftux wO6Yn4ahVJSUVRSDH4DKNvK900rciwneCVYkwwf0YW4+BquiBqbIblPYwFLxaNBYSkGG YmUERChpVXZX5VDKMtZz6c0b85x52p9Vw0Jdvg/iOqd2VhZm4hmtli2CE6nPpQKJ81uu EGbOnyaYffLSHu90eL8T8zKe59dpToEIyoby1N79mWmm753PKusMkDgxbG6LfXTy6Zjh eo7AL4fUK41Jf7RIiBfxDOgJ9jH9+HmWG03heKVfDmKcWdpNksq+0Grlc5bh2XhNSB9o Yq+Q== X-Gm-Message-State: AGi0Puajrc92/TrozOZsnKKAW7JWKE669gOMGeW5+rD0TAelQUDxZSFn zMIKf/p6Udlsy57bQ9qDFD89ZlqTSNTTS+iBsjM= X-Google-Smtp-Source: APiQypItbzbRAfykVwhYEziyW81i1VsVQsWKzuq5Om+rmRM/Bde2Tsi/00dCOsMjdpna8zPlStJjMTdDwFkXktWmeew= X-Received: by 2002:ab0:7392:: with SMTP id l18mr7000221uap.90.1587401591621; Mon, 20 Apr 2020 09:53:11 -0700 (PDT) MIME-Version: 1.0 References: <0a0c8c09-f863-96fd-866c-7dcc2b691904@fischer.name> In-Reply-To: <0a0c8c09-f863-96fd-866c-7dcc2b691904@fischer.name> Date: Mon, 20 Apr 2020 18:53:00 +0200 Message-ID: To: Markus Fischer Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000fc0d8005a3bbbbe9" Subject: Re: [PHP-DEV] [RFC] Mixed type From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000fc0d8005a3bbbbe9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > But how would this work for serializing resources, which is part of mixed= ? > https://3v4l.org/n9D2S The point is that many internal functions accept all types (including resources), even though they might not do much useful with some of them. Besides the functions that Benjamin mentioned, I'd add the *printf family that accept "mixed" parameters to the list. Seems to me exactly this case would benefit from a, albeit long though > more accurate, actual union type. Regarding accuracy, I believe the more types you have in an union type, the less important exact accuracy is, at least for return types and properties. For example if a function has a return type of mixed, I don't consider it a big deal if the implementation doesn't actually return 1 type (e.g. resource, null) in practice. M=C3=A1t=C3=A9 --000000000000fc0d8005a3bbbbe9--