Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94704 invoked from network); 19 Jun 2014 09:05:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2014 09:05:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.67 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.67 smtp67.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.67] ([108.166.43.67:55326] helo=smtp67.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/F4-60202-7E7A2A35 for ; Thu, 19 Jun 2014 05:05:44 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp17.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 918E5381DC1; Thu, 19 Jun 2014 05:05:41 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp17.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 18F043814C8; Thu, 19 Jun 2014 05:05:41 -0400 (EDT) Message-ID: <53A2A7E2.60509@sugarcrm.com> Date: Thu, 19 Jun 2014 02:05:38 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Sebastian Bergmann , PHP Internals References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A27E36.2010606@php.net> In-Reply-To: <53A27E36.2010606@php.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > The use case I am interested is test doubles. When I create a stub > or mock of a class then I do not wants its original functionality to > be executed. I just want to have an object that looks like an object > of the original class. When the original functionality is not executed, > though, how can we run into a segfault when the constructor of an > internal class is not executed? Dtors would be one thing. But another thing is that we can not ensure no method of original class would be ever called - even with mocking, etc., as most mocks do not override every method of the class, and even if they do there are handlers that can not be overridden from userspace, so if those are set and expect certain values be there they can be activated by third-party code which has no idea it's dealing with the mock. So we'd have a ticking bomb on our hands. So I'm not sure there is such thing as creating an internal object without calling its ctor or doing something else that initializes it. I understand why people may want to do it, but I don't think it can safely be done for internal objects. Unless somebody has some bright ideas that I have missed. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227