Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95636 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96170 invoked from network); 5 Sep 2016 09:49:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 09:49:22 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.192.171 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.192.171 mail-pf0-f171.google.com Received: from [209.85.192.171] ([209.85.192.171:36418] helo=mail-pf0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/6B-45301-0AF3DC75 for ; Mon, 05 Sep 2016 05:49:22 -0400 Received: by mail-pf0-f171.google.com with SMTP id h186so63470160pfg.3 for ; Mon, 05 Sep 2016 02:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WdchborhrYm1HuUM2LCBteg+JGE+qMaUjNg3TzMHjgI=; b=DpoVXiBUZFrSfmLBIyTvRkYkmFhjviHGsYAE+uRau/Hex7LH8uPtomyU39ZfPUH15T FVlCPFD0T8voOdfJ4m6oK4N7EErZcF+q2WrlEopsN1tkK881ER2UjTnzZHSOIroxYnlH txeu2ukdBlTBaet8/YSkmOgUIp54TeX2XZXZGnY43cB4hNwtuVzcVRjHf65vgCG/W1bk aKoy5gm0wB84uRCMtwtqBSb5SZhcgqBAM97584bDZcxrGSgzWmPEE6NL5DIne69ru6x+ FBvWedwfuPkTRX1dmlHD1lFRnaztaUzCkqoyx3fDT0wY+AQgkt+ZXMQFuDNgJfoDw7AV hABA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WdchborhrYm1HuUM2LCBteg+JGE+qMaUjNg3TzMHjgI=; b=kbRhbRL4Djr+tOgvx1F4kDnqaZES87EsEyVD4p5lIwhRlQVnnV4d3tagTlK4fnMUA5 JGNqW3H6afZ1RZ0XFhShJx+X4/IV8fsLtlxXQzE5aS/Q4mFdBPdcu0wq7e1ND3IqX4ei MjPrNjId/IJ7cYvIdXRwCSXCfSMaRqVeBZxfm+FjhO1yanqlpE4Un+Kb2oSknF1NVuHs 40vc7SKn2mRH4TzAiwJ0/rzfnPoULKM9zDnBpQHxWt3rMs/lydfb6wrOTwWRvqnGVMYm 8+mAgBQsZz8BVB5yKE6VKqb5lgAoSAzW/6cJpHrEPlThZDIchZOL1h1M1gSSFj0TtZ9Y JCvg== X-Gm-Message-State: AE9vXwOfCbIeLdWRrSYW+Ld0njMlRdYOJGxrwaeix6twsHemZhOwzbC9n+fhXuG4mNG7Y5ObEdqF8JtObFlLyxnkwF0UZC/0p/rZ2VZ8tFiWc81n6J3QF3/+vSbVVZh89Jwgql7K5KARdxxiSf/kAJxLwTBk+cm4sz+Hv9sWmnoohHKZPnGj9iRj X-Received: by 10.98.103.213 with SMTP id t82mr4060928pfj.158.1473068957326; Mon, 05 Sep 2016 02:49:17 -0700 (PDT) Received: from ?IPv6:2601:601:c00:99:c95:2fe1:cb7f:281c? ([2601:601:c00:99:c95:2fe1:cb7f:281c]) by smtp.gmail.com with ESMTPSA id v124sm32397930pfb.14.2016.09.05.02.49.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Sep 2016 02:49:16 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-B02D5AD6-8457-450F-9C9A-D4020DF592A4 Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (14A5346a) In-Reply-To: Date: Mon, 5 Sep 2016 02:49:15 -0700 Cc: "internals@lists.php.net" Content-Transfer-Encoding: 7bit Message-ID: References: To: Nicolas Grekas Subject: Re: [PHP-DEV] Missing reflection info about strict types? From: me@daveyshafik.com (Davey Shafik) --Apple-Mail-B02D5AD6-8457-450F-9C9A-D4020DF592A4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > On Sep 5, 2016, at 02:38, Nicolas Grekas wrote:= >=20 > Hello, >=20 > It looks like we miss a way to check by reflection if a function/method ha= s > strict types enabled or not. >=20 > We'd need to do this in Symfony to generate a file with concatenated > classes, but split "declare_strict=3D1" classes out so that they don't bre= ak > (because there is no way to create a single file that contains both strict= > and non-strict classes unfortunately also). >=20 > Would it be possible to expose some flavor of ZEND_ACC_STRICT_TYPES to > userland? Strict types are only enforced from the CALL site. A library author cannot d= ictate that their code be called using strict types or not, only the file ac= tually calling the library methods can. Though, regardless, the type hints d= o ensure that the value received is of the type specified, you just won't kn= ow if it was coerced or not. Just like when you import a namespaced class and alias it, the alias only wo= rks in the file the "use " statement is in. Therefore, you cannot actually author strict or non-strict classes period, u= nless they are only called in the file in which they are defined. This means you cannot reflect on it, unless we start doing reflection on sou= rce code files themselves. - Davey= --Apple-Mail-B02D5AD6-8457-450F-9C9A-D4020DF592A4--