Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76161 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31901 invoked from network); 26 Jul 2014 20:58:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2014 20:58:12 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.53 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.53 mail-qa0-f53.google.com Received: from [209.85.216.53] ([209.85.216.53:54015] helo=mail-qa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/F3-22380-26614D35 for ; Sat, 26 Jul 2014 16:58:10 -0400 Received: by mail-qa0-f53.google.com with SMTP id v10so6144341qac.12 for ; Sat, 26 Jul 2014 13:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GemN5FSVOsqQAFzZxEP1L6V3XiXoR9AIsSVioDi7WcI=; b=R0UwQojfPqQWOP/GzSerZTf30skMMohQRj/mtTV912SXQti7AiJ9JnNL+YEgeC8oy0 h8HcpLrgDAlnox/ZrWPYybj4EnAGpseVIzacLECqhaNsviX7++NnuBw0WD/H3TPytdNF 7qJvGEUzYC/KK5UrvoK63KKmAwOLQN7Yx4qCp0/+0J849vTskDMHoCI8N98RX2pv7uFh 6dbJMx2qJJXkR2bYiX6P7iEi9OfK+3ZJCYh15sldJ6Jos/2l6UvWTrvRAhkYRhq4GMrd IhESTUXLkFaukZCI/894RUe+62aUwjyBtNJ9Ts8agTzmcDQx1FXmFvearCIJWeQCWs61 ubbQ== MIME-Version: 1.0 X-Received: by 10.140.42.181 with SMTP id c50mr41063211qga.17.1406408296238; Sat, 26 Jul 2014 13:58:16 -0700 (PDT) Received: by 10.140.102.111 with HTTP; Sat, 26 Jul 2014 13:58:16 -0700 (PDT) In-Reply-To: <53D2E7A2.9010209@sugarcrm.com> References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A2A9BD.1070603@sugarcrm.com> <53A3874E.20704@sugarcrm.com> <53A62AFF.4080302@sugarcrm.com> <53B10D59.4060206@sugarcrm.com> <53D2DA3B.9020308@sugarcrm.com> <53D2E7A2.9010209@sugarcrm.com> Date: Sat, 26 Jul 2014 22:58:16 +0200 Message-ID: To: Stas Malyshev Cc: Alexey Zakhlestin , Marco Pivetta , Sebastian Bergmann , Julien Pauli , Remi Collet , PHP Internals Content-Type: multipart/alternative; boundary=001a113abd54e816cc04ff1ef253 Subject: Re: [PHP-DEV] Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: tyra3l@gmail.com (Ferenc Kovacs) --001a113abd54e816cc04ff1ef253 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Jul 26, 2014 at 1:26 AM, Stas Malyshev wrote: > Hi! > > > yeah, that would work ofc, but as these libs seems to have instanitate > > arbitrary classes, that would require either generating files on the fl= y > > and including them or simply evaling them, but of those are a bit > > dirtier than using Reflection for the same job. > > True but that's what phpunit, etc. are doing for mocks anyway, aren't the= y? nope, some mock frameworks do that (afair atoum for example) but phpunit(phpunit-mock-objects to be more precise) was using the serialize trick and newInstanceWithoutConstructor() ( https://github.com/sebastianbergmann/phpunit-mock-objects/blob/42f29d650744= fd7ce785e7a4dd3598a09b0bfd2b/src/Framework/MockObject/Generator.php#L273), and now they switched to Instantiator from Ocramius(he also participated in this thread) which also uses the unserialize trick and newInstanceWithoutConstructor() ( https://github.com/Ocramius/Instantiator/blob/86e562799ceb87316fcb70e151551= f47dd215a0f/src/Instantiator/Instantiator.php#L80 ). > > > true, but it can also be used to argue for loosening the restriction, > > why restrict something from Reflection, which is already possible from > > simple class extension. > > I agree, probably makes sense to allow it if you can do it anyway. > Reflection is not something you can trigger without explicit codding > (unlike O: thing) so it's fine with me. > yeah, exactly. > > > a nice thing from OOP POV and also will cause problems if/when we > > introduce a reflection method removing final from classes/methods (this > > was already proposed not that long ago with a working patch but was > > turned down because other reasons). > > That probably wouldn't be a good idea, especially for internal classes. > I should have left out this argument, because that has it's own can of worms, but if anybody interested in the original proposal: http://grokbase.com/t/php/php-internals/121gmxkz1c/php-dev-reflection-to-re= move-final I wasn't proposing merging this in my mail, just argued that if this proposal ever merged, that would either require fixing up the finals anyways or it would be possible to trigger similar segfaults and stuff. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a113abd54e816cc04ff1ef253--