Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109828 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66751 invoked from network); 24 Apr 2020 16:01:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Apr 2020 16:01:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 554A61804CE for ; Fri, 24 Apr 2020 07:33:30 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075028.outbound.protection.outlook.com [40.92.75.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 24 Apr 2020 07:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AzG7j0wZ806b/99O5hCsUviCOz3xNixDV2ho2DRHaaD9KHFk8MKUKRTaVhpRajxN3V2qiDQd8FkeWj0HaWHYDmeh9UjFVxJLv79em80OaI6+lClZQQsLAhTRR2KmrHTJjg4czpd2Lj1MGB6Mhf94A+uWKgUFg/qLNijEWdVK4GpHvRLxmm5w2LLNe7AToAstXG8Eg6m+LaPapu/GMGqkMN2iHwRuLCenpxObLbRRl8daS2zaEvyBXs0CBqDwIcH7CMxQwsOEoDk+J9UCq4S6QVZm56ak4elG6P1Hkk30VjHcFiy8XfzScLS+RAmDVBSCw87Ev9Svr9AE2+TM0WF7OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GqSTCk91xXtqss6LKlcb650wwhpPr4GJNuaNUv+XRvA=; b=Vw2NDiROTvvpJsaXRZCaq21SE1U9qVJAKQsyIUNv8BVaMZwswdcYngIXOJRhIvxq5utuAHFJyjf27xYPn4hHfNRoo8OWFxJPICFsvA86WXRnMWSXDtT9LypovcVXnI3jtwi8QKuv8xyz7iUBqPkfIstoOmaN4xpEWPBJPIY30jKzInqbna+fKYqQqXuspR0D/JRjxxVE7iDZunD/cE0n46NIDUL+3AY1LRDKG9ShSDDxkT/RClCna0Cougf3g4DisMB2YHVDoLy/bx6DOc/qmaTrr/Fkgixs/WbmJZqYcfe+3PG6KJOIpXVxT2nCY/s7OnJcIHU7pNpMn3Uj7vX6Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hotmail.com; dmarc=pass action=none header.from=hotmail.com; dkim=pass header.d=hotmail.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GqSTCk91xXtqss6LKlcb650wwhpPr4GJNuaNUv+XRvA=; b=K4kiBbyhWqEu8HfaBQ+NDTBFl4ix59rNPSfao6Rxh34I6jphirLdVj1jSs0G2m2zhGcV+rwdBhcM4+zkhytoKRE4EROipbyvFfPmnV+iRqPDNwfEcfL1KOnfRDX6YxP6fPtw3MUWPkbiTuejCRcvWgt0eL5h/iL3vz9bREpSQ232sm/0vVzHultMUsRAYckZl9gQH/WtVk+gz0fXQkTvRXRJsmrm/zN5m5bWx+OTBcb0Ea6M4wxi7bcHWVQOYIV1LmzvWzX8HV3jhqpWlqVhRB3BWq1uhoYHZ6zE2ro9YcFw52gqTDsc14sV5KEnc0XyWkz7/ofet/0d3Jh/YQWu+A== Received: from VI1EUR04FT019.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::43) by VI1EUR04HT065.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::367) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Fri, 24 Apr 2020 14:33:26 +0000 Received: from VI1PR02MB4703.eurprd02.prod.outlook.com (2a01:111:e400:7e0e::4e) by VI1EUR04FT019.mail.protection.outlook.com (2a01:111:e400:7e0e::251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Fri, 24 Apr 2020 14:33:26 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:B3B20D7AB0B4491E0BB543B2824D0FD5889AF265933A1FE41C0A40D6C99BB39F;UpperCasedChecksum:961BAFD1DF896CDB5489F47BD400B644FB799B8C73D17259EE9D05365BD6EBBA;SizeAsReceived:8997;Count:50 Received: from VI1PR02MB4703.eurprd02.prod.outlook.com ([fe80::61d8:9f5e:4baf:492d]) by VI1PR02MB4703.eurprd02.prod.outlook.com ([fe80::61d8:9f5e:4baf:492d%7]) with mapi id 15.20.2937.012; Fri, 24 Apr 2020 14:33:26 +0000 Content-Type: text/plain; charset=utf-8 In-Reply-To: Date: Fri, 24 Apr 2020 16:33:24 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Dan Ackroyd X-Mailer: Apple Mail (2.3445.104.11) X-ClientProxiedBy: PR0P264CA0072.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1d::36) To VI1PR02MB4703.eurprd02.prod.outlook.com (2603:10a6:803:8f::13) X-Microsoft-Original-Message-ID: <27244BF1-114A-4333-AA6D-93B465243539@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2001:7e8:cba2:c100:1d9:c36:bbf3:36a6] (2001:7e8:cba2:c100:1d9:c36:bbf3:36a6) by PR0P264CA0072.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Fri, 24 Apr 2020 14:33:25 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-Microsoft-Original-Message-ID: <27244BF1-114A-4333-AA6D-93B465243539@hotmail.com> X-TMN: [E157vSbyNRwR5yhnT/WDj9dsZ3Z8YIiEiWXIYONaL83cbgoA5gTfjrDkcZ71OVcZ] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c02585cc-7927-48a6-b925-08d7e85c72c9 X-MS-TrafficTypeDiagnostic: VI1EUR04HT065: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K0/ch5E4XUWFPBDzBNnatU5Eh4BqLYlEzpsfWEFhNypmtqYANTCsX9RyoRcQ+hPNiyAAD5RSCvX8hvFbamInckfJ+d0tcU7fAcnhe7zIlFp2duBp4KJ5qVx0RWbGaAQEct8V+EacIe+2dBVpEnhULoQb5B9Qwe8gIOjABpdB7Wl6VnZ2JaM30X1vRZIRNhD7GDSQkR5vP6n30hLflPc0A9DLPVbOYDRLRE7G8JDvaEfWjmRaSe4s+bAXVVmqKEGh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR02MB4703.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: CWeo0t2CV5n4Db8l33gDPMwrjN2BJ35/0Mtko1cX0F2HtWOxRu+NcFRL6IP7OEuJTrZ9R91EZRsdJD1G8AepmzlvZ9ykLxQyo46AwXmuuyiNqDUOPIG6+jna9FZUN4SnoGFF9VxmY7UQ6idvnBWfW+p40hCqUlft1mX/Uv64hmjPfFPaavs4dmQUFy+57PHvrB4h9aoeD48Oa4WESadNLQ== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: c02585cc-7927-48a6-b925-08d7e85c72c9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2020 14:33:26.3388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR04HT065 Subject: Re: [PHP-DEV] [RFC] Mixed type From: bobwei9@hotmail.com (Bob Weinand) Actually, I forgot that for proper generics implementations, collections etc. will ob= viously need to specify "allowing any type". As such the introduction of mi= xed is pretty much necessary. As in class Foo { =E2=80=A6 } $foo =3D new Foo; As such, I'm actually in favor of introducing it. Bob > Am 24.04.2020 um 14:11 schrieb Bob Weinand : >=20 > Hey Dan, >=20 > this, I consider one of the few concepts which should never make it into = PHP. >=20 > In particular, the main problem with mixed is that it is a very easy "I h= ave no idea how to type that properly, so just let's use mixed". >=20 > And really, in general, except for some debug functions, mixed is just an= excuse to not use proper generics. I cannot think of non-debug scenarios w= here we are juggling truly unknown types where the type is unidirectional. > (Uni-directional means: there is no corresponding getting/forwarding func= tion for an input.) >=20 > 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 t= he type system than supporting mixed. >=20 > Mixed is a hack, do not use mixed. >=20 > Bob >=20 > P.s.: If you want to migrate your types and have an overview of what's al= ready migrated, maybe just add a comment // type-migrated before or similar= ? But that's seriously not the business of the language. >=20 >> Am 20.04.2020 um 13:17 schrieb Dan Ackroyd : >>=20 >> Hi Internals, >>=20 >> Here is an RFC for adding a 'mixed' type to the language: >> https://wiki.php.net/rfc/mixed_type_v2 >> The RFC builds on an earlier draft by Michael Moravec. >>=20 >> Part of the motivation for pursuing this RFC was my recent experience >> in upgrading an application to PHP 7.4. >>=20 >> Being able to add types to the application made the code much easier >> to reason about, but there were places where I couldn't add type info >> due to the lack of mixed. That made it hard to see if that piece of >> code had been upgraded (but type info couldn't be added), or if that >> code still needed to be upgraded. >>=20 >> cheers >> Dan >> Ack >>=20 >> --=20 >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >>=20 >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20