Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37120 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8044 invoked from network); 17 Apr 2008 21:14:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 21:14:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain strojny.net designates 85.10.204.248 as permitted sender) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 85.10.204.248 milch.schokokeks.org Received: from [85.10.204.248] ([85.10.204.248:51300] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/E9-05127-8BDB7084 for ; Thu, 17 Apr 2008 17:14:34 -0400 Received: from [192.168.0.100] (xdsl-87-79-211-210.netcologne.de [::ffff:87.79.211.210]) (AUTH: PLAIN lars@schokokeks.org, SSL: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by milch.schokokeks.org with esmtp; Thu, 17 Apr 2008 23:14:29 +0200 id 0000000000020008.000000004807BDB5.00003ADC To: Felipe Pena Cc: internals@lists.php.net In-Reply-To: <46ccd1ab0804170742g142ed562t4f03339da549a820@mail.gmail.com> References: <46ccd1ab0804170742g142ed562t4f03339da549a820@mail.gmail.com> Date: Thu, 17 Apr 2008 23:14:28 +0200 Message-ID: <1208466868.4430.10.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_milch.schokokeks.org-15068-1208466869-0001-2" X-Mailer: Evolution 2.22.0 Subject: Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value) From: lars@strojny.net (Lars Strojny) --=_milch.schokokeks.org-15068-1208466869-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Felipe, first of all, thanks for your proposal. I like it. Am Donnerstag, den 17.04.2008, 11:42 -0300 schrieb Felipe Pena: > Hi. >=20 > Well, thinking better about the behavior of type hinting, i decided to > change the proposal for strict type. I.e. don't accept numeric string > as an intenger, etc. [...] I would also like to see scalar and numeric too, but that's just for the record.=20 For ReflectionParameter I would like to see an additional ReflectionParameter::isType(string $type_name) to allow constructs like foreach (array("string", "integer") as $type) if (!$reflection_param->isType($type)) throw new Exception(); What about additions in the ReflectionMethod-class? I would say adding ReflectionMethod::isInt(), ...::isDouble() and isType() would be appropriate. cu, Lars --=_milch.schokokeks.org-15068-1208466869-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Dies ist ein digital signierter Nachrichtenteil -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iQIcBAABAgAGBQJIB72nAAoJECQPF+sCY6wHvJkP/ith4ZINRKFfo1NjAQt8Uh9J 9Xj9tRhPk4yGNM09pw4fnD+4YfJuuRHuRFJy+IRSufYqlDt0slJ1hToL6nfQK4R/ yMGos3MMV3xncjitlEwFL5o3BFPDkqfMr6lHEipDB6wchfclnRK8wo6OQUjP5+8j XIobOxWXttgY5KVd/b52GWhgIw38+9frwGaAF/vyUiOtxjOyZzdTVrX2bzPD+ZMh gyYftKZogk2Gce9yBo3+JTgBHAYdzH2PoXzNy6aIbYs1M2bE1S0TX/auv/XM3Cep Pppi5pS+OJVgWJjbeAUmzAZBzgiGNAqhLED5MBffXiPuGJxg0H5SNYwmwwLWngLa 5zvFGiZFC0Bv2XUGRTsd/YmQMQ9XGzC4htEJq0pLSbJFm96xN41QXSOfplUwN5zb 0pSO65fDaFHRF8u7ecZ+QN/ISsVSW9x/tXleIgyh/Rp/NIKH7/fdC/5yKgLfSENc PzAiIok63wUun8wMH2oWqRYq+V2ZzyHytFUmIK4SpiFKW7/3SFjbRcnwnqm4No3/ yZNIbDsUFiFBo8LTm3Wm7+bjWFtEz0o/L6XZqyW89XI7RhZJ5SgZfGauBzf6rkj9 qztTKwjSQwfld/39wP7FiuRa/FtCwHEVNYkb0H7STPW5tLFJnIF56JL6Qe7E9LUa 8Mj8SAcjJPcIwquOGgzw =EtSa -----END PGP SIGNATURE----- --=_milch.schokokeks.org-15068-1208466869-0001-2--