Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56758 invoked from network); 5 Sep 2016 20:38:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2016 20:38:13 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.178 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.178 mail-yw0-f178.google.com Received: from [209.85.161.178] ([209.85.161.178:34741] helo=mail-yw0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/3A-45301-4B7DDC75 for ; Mon, 05 Sep 2016 16:38:12 -0400 Received: by mail-yw0-f178.google.com with SMTP id g192so53694317ywh.1 for ; Mon, 05 Sep 2016 13:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OAGy/FXz2N9vLod9QYUApEzEjLQjnETgR5u9P0knrMQ=; b=OWSsFB5tiOrn/v0HZ8jpjuxu7YMq6U8s5FQ+7v8CdJbtc+M39We4PDGP9og+JJ/twk D0t5HryAAR70w4INPYH0ihggte1gl5D8l5Phmo06FPoAD35YsZ3AayPx7tK3gEymd0TF Pl4N5FLU3dXdT4teg4YFwdRUa+i33GdcqRiTn78sWWKUfF+FWuvrV7/EVmGOPioaEPfD iCWmCo7BN8fxPgg6iWCmHbprGkeOPkq3KSpc9tpmiADT2ieOavw9VHjZNnnVfr3FLBHs JDqlBNUKE5BEVCzTcNfCTTYHXFFtMF0gWgO6azBjjHJ4m4w46WrsUyiJm1/WcEQAedpq 07eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OAGy/FXz2N9vLod9QYUApEzEjLQjnETgR5u9P0knrMQ=; b=lXkhZtfQZ962nXF+nRqMho1B+9xu0DrlsV5+IGCUMkjPtICHPw8I3LOnbXSpzc/XkU GaXcme3XPGiQtwRSSLwmo/v5ORA/x3owovYmuELUEO3D/7BGzzhoarYHq9JQm4DflUTS lAdLOkVnKzQPkvoILsH/L8+6vlN6CaMsX3tGOx9zxqdmlk+JAWCje+W4q09xn12vu6gx 896vihkNSL6DNQiJB0/PgV6bskC26cgal4/GyouqpEfV1vCVi/xgmEM7BexA8zhPkp6j KyNRLwG6fppJlNnXp0yFUw5tASJsDBM/7ZUC77hxv1Te4Gs+ixQOeXCwvOL7cv2Q6t4l Zt/A== X-Gm-Message-State: AE9vXwPi35UCHQfVR0V6idnVoC5LRfBPP8BP08SnjJwt0AuAk0OtrUy0ypiMKhdw9H8UcBqGoblVUrZtmFnKxw== X-Received: by 10.129.61.13 with SMTP id k13mr29654541ywa.56.1473107889154; Mon, 05 Sep 2016 13:38:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.215.15 with HTTP; Mon, 5 Sep 2016 13:38:08 -0700 (PDT) In-Reply-To: References: Date: Mon, 5 Sep 2016 22:38:08 +0200 Message-ID: To: Davey Shafik Cc: Nicolas Grekas , Niklas Keller , Pierre Joye , PHP internals Content-Type: multipart/alternative; boundary=001a11428114730ca7053bc8a80c Subject: Re: [PHP-DEV] Missing reflection info about strict types? From: nikita.ppv@gmail.com (Nikita Popov) --001a11428114730ca7053bc8a80c Content-Type: text/plain; charset=UTF-8 On Mon, Sep 5, 2016 at 10:30 PM, Davey Shafik wrote: > On Mon, Sep 5, 2016 at 1:13 PM, Nicolas Grekas > wrote: > > > > Why do you concatenate these files in the first place? > > > > > > > > > > It's not specifically me but Symfony's ClassCollectionLoader::load() > > method, which generates a single file with common classes inlined for > > faster bootstrapping (the perf gain is objectively measurable). > > > > You give this method a list of classes that are always required, and it > > computes all the required parents/interfaces/traits they use, by using > > reflection of course. It turns namespace to the bracketed syntax, orderd > > things as required (parents first), and dumps everything in one php file. > > > > The issue came to our tracker that this process was broken once one > wanted > > to inline a strict class there, either directly or indirectly through the > > parent chain. > > > > Again, there is not such thing as a strict class. You should be stripping > ALL declare(strict_types=0/1) from the class files, and even if enabled it > at the top of final generated file it wouldn't make any difference _unless_ > you're calling the classes IN the generated file. Anything you include it > into will decide for itself whether it is strict or not. > 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. As I see it, the issue here is really not how to figure out whether a file uses strict_types, the issue is how you mix strict_types=1 and strict_types=0 code in a single file. Back when this feature was introduced, we decided not to allow this kind of mixing, as it seemed prone to causing a mess and use-cases seemed doubtful. Given the issue Symfony is experiencing, we should reevaluate this decision. Imho it's not good if there are some things you simply *cannot* express in a single file. Nikita --001a11428114730ca7053bc8a80c--