Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109824 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22353 invoked from network); 24 Apr 2020 13:46:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2020 13:46:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3CA51804CB for ; Fri, 24 Apr 2020 05:18:34 -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,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-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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, 24 Apr 2020 05:18:34 -0700 (PDT) Received: by mail-il1-f178.google.com with SMTP id t12so9038428ile.9 for ; Fri, 24 Apr 2020 05:18:34 -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=6AbcuZOMnz9tK4StjKXBG1KYdNtzQrm+kbUb7j4Y3CU=; b=TEUCIg2G8A5klnncYx3J1V2ImK2ErDYIWWddBFftbDqQdBioGbXRN0NeseOaXcxq4A tbevlAWtl8P8aGf/1iYYCG5vHQYwmB6pl/lVzkdyK9h+VwxouYfnPDLGVx2c7s7JCJ5/ Jgk68DBmCGWLc6VrhDcakvQftrFyFdDBz89bZC2Ouenyn+Wm5VWrfOLgbkUMzm+twLQv ZI6itn6mLc4g0eYgw+kBJzhgyVKHMz9JjBJA2v8QPrG2jZqQdqG49lL2/20zkM6CmaFh dxAezHbUCE6CKlIbE3H8LyxdeosyOJyUFcnejldugsg/M4CXsX/haNDzCvqq7sqF8tGc aBkQ== 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=6AbcuZOMnz9tK4StjKXBG1KYdNtzQrm+kbUb7j4Y3CU=; b=JOo2jqPcgk3T2JZWPU1xCcwDHmN3fRlhauY6jccvgYbUSh4toQpi9h5y9l4xfiMPfQ aZ11ozBaYGTQEw6RDh4jb1L2nTRHoRQpa2LWXz14QmTxod9LnUuuK3WJ4vXoxTrzzzth gppxNgK7Qvis6FpiR97DM04I/t2377tIhDJI2v9p/1TirrVYZ0HuSwkbOSJWRKP107ee LWtt3r6aD7bLzN3K3mcyvtoVQkV4tWIsH5L+1F6bT0SQOWwWINwuBP/LlNDCS5k53MN3 GZAgOciQ9PMSxeYuEVtyGhw8niYMUSpo6Ti8X0LDj2KrRg1MCrF9gRsbDFsm9mot59oA yg6A== X-Gm-Message-State: AGi0PuZY1ABH+PKOe2qREZcnniMVgNpA0wF3sGyVIFxj6dPTHPCdCVaB FicPojttV2PBOJo83qSxBf8BYz6bNBYvmDIvlj4= X-Google-Smtp-Source: APiQypIbGc00D/1FUPpmZzbGOb2rE6ZzAVNPXj8uUW7r9uEDoI/GIdwIeAcSYGlZe+L0u/OTm0EQmDqLgn1Rc1baQc4= X-Received: by 2002:a05:6e02:68e:: with SMTP id o14mr7656398ils.33.1587730713820; Fri, 24 Apr 2020 05:18:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 24 Apr 2020 14:18:07 +0200 Message-ID: To: Bob Weinand Cc: Dan Ackroyd , PHP internals Content-Type: multipart/alternative; boundary="00000000000032444705a4085dc9" Subject: Re: [PHP-DEV] [RFC] Mixed type From: kjarli@gmail.com (Lynn) --00000000000032444705a4085dc9 Content-Type: text/plain; charset="UTF-8" On Fri, Apr 24, 2020 at 2:12 PM Bob Weinand wrote: > Mixed is in almost every case just patching the holes in PHPs type system. > And as such, I'd rather promote RFCs trying to properly fix the gaps in the > type system than supporting mixed. > > Mixed is a hack, do not use mixed. > Heya Bob, I maintain lots of legacy code and I cannot add return types despite being truly mixed. Mixed is not a hack, it's a scenario that frequently happens. There are lots of use-cases where we explicitly want to mark it as such as it truly accepts anything. Would I use it in new code? Pretty much never, as `string|int` would already cover the majority of cases, especially where ints are represented by strings. I would love to see mixed being added as it lets me remove a lot of docblocks that are only added so I can indicate mixed. I disagree that it's patching holes, it's filling a gap that's currently missing something. Regards, Lynn --00000000000032444705a4085dc9--