Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75469 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99077 invoked from network); 14 Jul 2014 15:02:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2014 15:02:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:39779] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/81-25444-401F3C35 for ; Mon, 14 Jul 2014 11:02:28 -0400 Received: by mail-lb0-f178.google.com with SMTP id 10so2888540lbg.37 for ; Mon, 14 Jul 2014 08:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=XGP15d+9CwYRNPqMV3295d7GbAP73LipZePP5AZxp9c=; b=wdh6bT8cwP7eTXFf3wKWfK7D+MOSY3shBdX6P50q+Kfg7tbsr9YNXJbwtVHLFXYPX6 rnQbMPw/QL2BxWIjpisLVcQaBekE12UBnR94pa5zVWGXZDTblzly/UFnScwK7SQemJme evpD6hQM/KepadnfQruJL9lzwiMLtw6dSqT4jlJ1teGvf8p3T4F8KLPdpa9PUSIaY1o1 RxgA3cM+H4hFZH2IHvlxULaZRj65ghE/ORhsBNditgsvCA1AdfAxrILl9Vybr5v+7Gwh pAabt70gFfEm1N0750x6b69EOzWUxLDzKxSOsuT14+t0mTYgZkgpOcNcIN847aq7+MfY FX1Q== X-Received: by 10.152.115.173 with SMTP id jp13mr14430882lab.6.1405350145377; Mon, 14 Jul 2014 08:02:25 -0700 (PDT) Received: from [192.168.1.26] ([92.255.5.146]) by mx.google.com with ESMTPSA id 10sm5470454law.22.2014.07.14.08.02.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 08:02:24 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2278C9ED-E93E-40AE-BAAD-390652E6F434"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.1 (fa3e4a3) In-Reply-To: <6C08D5C1-7A37-4F49-BF12-96B614B4B50B@ajf.me> Date: Mon, 14 Jul 2014 19:02:13 +0400 Cc: Derick Rethans , PHP internals Message-ID: <76F7478E-3425-473C-9ACA-31253E44A335@gmail.com> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <6C08D5C1-7A37-4F49-BF12-96B614B4B50B@ajf.me> To: Andrea Faulds X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: indeyets@gmail.com (Alexey Zakhlestin) --Apple-Mail=_2278C9ED-E93E-40AE-BAAD-390652E6F434 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 14 Jul 2014, at 18:57, Andrea Faulds wrote: > On 14 Jul 2014, at 15:54, Derick Rethans wrote: >=20 >> A compromise by adding more inconsistencies. >>=20 >> I can buy the cast of scalars vs hint--of-complex types, but = definitely >> not the introduction of a new group of casting rules. Keep it simple. >=20 > It doesn=92t change the casting rules; write an error handler that = ignores E_RECOVERABLE_ERROR and you get exactly the same result as a = manual cast inside the function. Rather, it simply adds validation. The = casting works like casting does everywhere else, but there=92s strict = lossless validation on the type hint, similar to the non-scalar type = hints except more lenient as it allows equivalent values of other types. ok, it might work for me if formulated like this. now, the question is, would it be possible to port these rules to zpp in = PHP-Next? if the answer is =93yes", then I=92m all for it. otherwise, I=92m a bit skeptical as inconsistency between extension-land = and user-land code worries me -- Alexey Zakhlestin CTO at Grids.by/you https://github.com/indeyets PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc --Apple-Mail=_2278C9ED-E93E-40AE-BAAD-390652E6F434 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBCgAGBQJTw/D+AAoJEMkJcRxZdR2739MH/inQKR3X/0QNaEjrC6FlDEUw JlOx7arIUF54V8PBjTfZbjV8DnBe7hd8z8V+l8T04gBdQnZuBNBGfYI0+1+WQfMQ S9zKX0ayBJ2k9QmDKXSsnEV3oCo/EPYgTo2kvlgU7sB9rle1oFki0CY2i3BeZf48 WvmdWF61ssRekTtoe0mg1P+JPyqvLgJSkziBA4HX8BFo1w22+3G7Bcw9fMMQiyFq as2JOQroAFsEYnyHUiUkoEZ/fDEbfWp4eP7iNqz+3PkzGNHgGFq62TeLFGy4BKkz plxB9axqb7U4aWoS4hCs08ARfGtOE11gX9bs6XNMH5/HmFIa//chcCBqSgmyhJw= =WbDU -----END PGP SIGNATURE----- --Apple-Mail=_2278C9ED-E93E-40AE-BAAD-390652E6F434--