Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77298 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10300 invoked from network); 17 Sep 2014 17:09:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2014 17:09:28 -0000 Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:58049] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 94/A8-57031-640C9145 for ; Wed, 17 Sep 2014 13:09:27 -0400 Received: (qmail 8181 invoked from network); 17 Sep 2014 19:09:21 +0200 Received: from unknown (HELO RoLaptop) (80.66.46.208) by ns73.kreativmedia.ch with (AES128-SHA encrypted) SMTP; 17 Sep 2014 19:09:20 +0200 To: "'Rowan Collins'" , References: <74D45E97-4C96-41FA-B824-BCEBA056C654@ajf.me> <001101cfd1e1$c1f2df00$45d89d00$@tutteli.ch> <5419B057.40101@gmail.com> In-Reply-To: <5419B057.40101@gmail.com> Date: Wed, 17 Sep 2014 19:09:14 +0200 Message-ID: <002901cfd29a$1ca537a0$55efa6e0$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQL6iJtCQAzQy02K2ulPik/onvJC9wLFSCauAXGZf0wB4Js5sgIoywMxAXUiNi+ZYnXkoA== Content-Language: de-ch Subject: AW: AW: [PHP-DEV] Renaming type-hints to something else? From: php@tutteli.ch ("Robert Stoll") > -----Urspr=FCngliche Nachricht----- > Von: Rowan Collins [mailto:rowan.collins@gmail.com] > Gesendet: Mittwoch, 17. September 2014 18:01 > An: internals@lists.php.net > Betreff: Re: AW: [PHP-DEV] Renaming type-hints to something else? >=20 > Robert Stoll wrote (on 16/09/2014): > > I would argue "type declaration" is wrong as well since it is not a > > type declaration as it is known in other languages where the type > > declaration is binding. IMO it is more a "type check". Consider the > > following > > > > function foo(Bar $b){ > > $b =3D 1; //$b is not a Bar at all > > } >=20 > I tend to think of them as "type assertions", since this: >=20 > function foo(Bar $b){ > // do stuff > } >=20 > is kind of equivalent to this: >=20 > function foo($b){ > assert($b instanceOf Bar); > // do stuff > } >=20 > i.e. it's a runtime-enforced check >=20 I would prefer "type assertions" over "type check". Yet, I agree that = changing the naming might cause more confusion than it is helpful. Nevertheless, if we think the naming will cause harm = in the future then we should consider to slowly change it. Make "type hint" somewhat deprecated and change it in the doc = but leave a notice. Something like "type assertion (in older days called type hint)". And at some point we can = remove the notices.