Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74983 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90397 invoked from network); 19 Jun 2014 08:43:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2014 08:43:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:36833] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/14-60202-4B2A2A35 for ; Thu, 19 Jun 2014 04:43:32 -0400 Received: by mail-vc0-f180.google.com with SMTP id im17so1916635vcb.39 for ; Thu, 19 Jun 2014 01:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Miam5M9eEFve2p7B87UNEn2KMQ/qIGozLeHFXrlhtL4=; b=s4a0LtIpXnInKiBY3NOPL5aOFHsp5nghcpEgRizIdGbkWXpw+zUdrCH186Llu9WX/x KWvGX9y74GQPhuZr55Q3YCR0iGhMnm2lTUO/ercktpSeLPF2Sw80FMogdkbNrOzDNdrL oMIx1wWa+mp6YIJPK/wl6Mh73H6y7zBihxoknKl1miuZE5hN4K5sxnBaVkxYr7WXbvX7 QCLd8dkFdpZfuRQ/KsuapZnUUT61ib+3V6Jf+4wTbCdauxMIIvDn+m008pUvWdO50tP9 i0jKZfZQ2H4gH7Dz6GLhmVas6H0QDyWdb3nc3wMqwCY26JT9eLjAgKM9j+GZnrPXYcyN nCPg== X-Received: by 10.58.188.37 with SMTP id fx5mr2951881vec.17.1403167409824; Thu, 19 Jun 2014 01:43:29 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.81.68 with HTTP; Thu, 19 Jun 2014 01:42:49 -0700 (PDT) In-Reply-To: <53A27E36.2010606@php.net> References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A27E36.2010606@php.net> Date: Thu, 19 Jun 2014 10:42:49 +0200 X-Google-Sender-Auth: YasPITgictQLJeXGi2PJLJphQNE Message-ID: To: Sebastian Bergmann Cc: Stas Malyshev , Remi Collet , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: jpauli@php.net (Julien Pauli) On Thu, Jun 19, 2014 at 8:07 AM, Sebastian Bergmann wrote: > Am 19.06.2014 00:22, schrieb Stas Malyshev: >> How we can safely make that? For internal classes I'm afraid making them >> work safely without ctor would be a challenge - after all, all the code >> expects ctor to run. For user classes at least the engine would throw a >> fatal error at worst, but for internal classes we'd get segfaults all >> over the place. I'm not sure how this can be done safely. > > 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? Because you'll need an object, so you'll need to create it. Internal classe based objects may have some more logic that just executing their userland's __construct() , that's the case for SplFileObject and many other ones (date, xml ...). Internal class based objects have an internal constructor which is expected to be called (the create_object() handler). It has never been planned for this internal constructor not to be called. Julien.P