Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95676 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59784 invoked from network); 5 Sep 2016 20:48:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 20:48:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.87 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.87 mx106.easyname.com Received: from [77.244.243.87] ([77.244.243.87:50505] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/8A-45301-62ADDC75 for ; Mon, 05 Sep 2016 16:48:41 -0400 Received: from cable-81-173-132-21.netcologne.de ([81.173.132.21] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bh0ok-0007OM-UA for internals@lists.php.net; Mon, 05 Sep 2016 20:48:35 +0000 Reply-To: internals@lists.php.net References: To: internals@lists.php.net Message-ID: Date: Mon, 5 Sep 2016 22:48:25 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4T84BoOM6UlGMD8Rd5w9dCiS5tiNAj8vL" Subject: Re: [PHP-DEV] Missing reflection info about strict types? From: php@fleshgrinder.com (Fleshgrinder) --4T84BoOM6UlGMD8Rd5w9dCiS5tiNAj8vL Content-Type: multipart/mixed; boundary="7lSHOBu8L5Qb1TvKraurCHbro6g54I5ti"; protected-headers="v1" From: Fleshgrinder Reply-To: internals@lists.php.net To: internals@lists.php.net Message-ID: Subject: Re: [PHP-DEV] Missing reflection info about strict types? References: In-Reply-To: --7lSHOBu8L5Qb1TvKraurCHbro6g54I5ti Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 9/5/2016 10:38 PM, Nikita Popov wrote: > Stripping strict_types declaration will change the behavior of the code= > declared *within those files* (not the code calling that code). The > behavior should not change in the merge process. >=20 > As I see it, the issue here is really not how to figure out whether a f= ile > uses strict_types, the issue is how you mix strict_types=3D1 and > strict_types=3D0 code in a single file. >=20 > Back when this feature was introduced, we decided not to allow this kin= d of > mixing, as it seemed prone to causing a mess and use-cases seemed doubt= ful. > Given the issue Symfony is experiencing, we should reevaluate this > decision. Imho it's not good if there are some things you simply *canno= t* > express in a single file. >=20 > Nikita >=20 Well, I still think that the declare approach is kind of weird and creates two PHP worlds and that it would be easier if scalar type hints are always enforced. However, I do not see why it is an issue for Symfony here. One can use the tokenizer to check if a file has a strict declare in it and instead of creating a single output file create two. One that has no strict declare and one that has a strict declare. It might have a slight performance impact compared to a single file but it solves the issue at hand. The issue you describe (inability to express something in a single file) is part of the design of declare ... --=20 Richard "Fleshgrinder" Fussenegger --7lSHOBu8L5Qb1TvKraurCHbro6g54I5ti-- --4T84BoOM6UlGMD8Rd5w9dCiS5tiNAj8vL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXzdogAAoJEOKkKcqFPVVrj/QP/Ro8NKzWHFOCyTox9GXg1BcH PZqoV6H8ZPpDHXYGI/YEbfsETnpDnlqaohHl3bCt7wm119vfzI3b2f8tKCd+qnM9 /rOgtrGcX2wH6ATooTjkYTYrScaJh7y26WZoChJDEd/9WGRPD1mDb1N8P8B43ZSN oBmeQaouHcU6i48Lf+45X5rYcrdVlHzQJErEob3LZZgqg5tB4qbe9TJ3qBeKMSCe 0GvxAqQPFdw7mI79zpZ2+NVCZYy5WmUTqu1y1SB5sW7/fhumSO5VqtrhTxk9i+6k sHi6iee5Kh3In1EtYahSETPEqetKW0GqiiegvcQ60eivdZw3c06qQes0egxG7kC5 6B6yNtxePWVHQJ3zGwzsQCnKjuNuAggPHsYZUs7IqIJS7u0GvHhc5SMqOgd6Ih8P sm2QpuPsQ5qJrukeqhHDZU+2nA+DKRBIYGtXvmqHHm4LZhcYvAc536Sn0IACssZq tmEQC2Ayo9ePUbDiYVRhg+enjplct2grNG8WhEiFwmhI1jZz064IMzX/e9C5FXqe rRmB6sldgvNyQ3HhErLD4RACiAKcuucfyyoaOxUZNw4fQWgRjMYIuv6A/3GJFfdB mLqgtSIBLQrsvA87nn+Lksh84jECnF7XZe6BXWVP0IxaqcJG4sLXxFNUdb/4Ysww GxkvIg/kXHwkWSwxMjIb =wmv9 -----END PGP SIGNATURE----- --4T84BoOM6UlGMD8Rd5w9dCiS5tiNAj8vL--