Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109990 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76629 invoked from network); 4 May 2020 17:09:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 May 2020 17:09:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9B0F81804B4 for ; Mon, 4 May 2020 08:44: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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS2639 136.143.188.0/24 X-Spam-Virus: No X-Envelope-From: Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) (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 ; Mon, 4 May 2020 08:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588607065; cv=none; d=zohomail.com; s=zohoarc; b=bd8zpkTzsO7M9lnqFuPvF0xBDlMmpu5OL1Gle+alRlQaqFUljxjYct2fVgLLqO+naUg/YxoYvT9iY+/Fhu8vnmqLHg+mV+yzGGZ5TJ03qO6LxGk1El/JiwCjKV5/1TWo+3idyjq/jjTLz7vprJ3YOkbzxulTSTCEt4Z3V+ltBrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588607065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=giuQ1E1xCEK5iVi36axjaOxPZX+/CUek/w+138Uygvc=; b=BHI8LMC6Fxbtmuyfmo5w6ccWcWjAuxbe3lYfNTT1KvlRnHlJHTEoDpSSznHpXBQAz1Nt7b8FPcCRyB0XTeba0cM9dgTapQCX6cioDhvB++R1Q0FNsDLfeYchBnbK439sjucPsXHyhgSGyHIUdfenkAACitpYUB6AciUZqScfMbI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=manuelcanga.dev; spf=pass smtp.mailfrom=php@manuelcanga.dev; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1588607065; s=zoho; d=manuelcanga.dev; i=php@manuelcanga.dev; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=giuQ1E1xCEK5iVi36axjaOxPZX+/CUek/w+138Uygvc=; b=BkscjJEu/6L9ER1xMXtYq3EBN3FdpkLRFbkcPVNfSv1tKmpOHgf0qQHaqzm9lmX7 EnzC1qU6VS2ZKcx2LyelgXuBYI/jjZa6iXLhy6PQNRHWenCdk/HL3T3Z3st6jSLdYe2 DrcAa+lALc2hu6JWSD0MFEB2/oCIMMrOf/5zzDrk= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1588607032189711.9859020314169; Mon, 4 May 2020 08:43:52 -0700 (PDT) Date: Mon, 04 May 2020 17:43:52 +0200 To: "Matthew Brown" Cc: "Internals" Message-ID: <171e05b4ced.1041f31b5124598.4028595156690203917@manuelcanga.dev> In-Reply-To: References: <171dee3baf3.bef5753260554.3262181919550021853@manuelcanga.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Subject: Re: [PHP-DEV] [RFC] Keep type of reference params From: php@manuelcanga.dev (Manuel Canga) ---- En lun, 04 may 2020 15:01:44 +0200 Matthew Brown escribi=C3=B3 ---- > This would break quite a lot of existing code, though PHP could add an > explicit keyword like "inout" that catches this behaviour (see example i= n > Hack: https://docs.hhvm.com/hack/functions/inout-parameters). >=20 > Today these issues can also be caught with static analysis: > https://psalm.dev/r/1f670956ab =20 Thanks, Matthew, I don't know about inout. I think I=E2=80=99d be positive of adding `inout` keyword in order to: - Check type of out is equal to type of param( like example of my first ema= il ). - Avoid modifying caller var value when the function throws an exception Other option is adding to normal reference( & ) these behaviours when stric= t_types will be activated in caller.=20 Regards -- Manuel Canga