Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19023 invoked from network); 25 Aug 2011 12:26:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2011 12:26:34 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:57884] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/E2-00227-A7F365E4 for ; Thu, 25 Aug 2011 08:26:34 -0400 Received: by qwi4 with SMTP id 4so1328412qwi.29 for ; Thu, 25 Aug 2011 05:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=l9cyFy+OZOeGy5iTGl/eieZCmAEEoyD4vdM5J5rRTqE=; b=nsIs+mD7ANf2A/k2kEQVr0zB/S4vzrzMkffae/H9lFZQn7mviCjQo2Don1aTO8nTJD 2ca11gK+YCPms2U6VSpgSmuFhMc7/QV9zfsBFJip1PqAGkxULs8kj9eI/cDY1Id2cam0 DiilI0U6dy8+dA2xt6mYczkEBjNzjxvo22XCs= Received: by 10.229.59.138 with SMTP id l10mr454064qch.209.1314275192196; Thu, 25 Aug 2011 05:26:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.184.137 with HTTP; Thu, 25 Aug 2011 05:26:12 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: <4E5619ED.40609@php.net> References: <4E5619ED.40609@php.net> Date: Thu, 25 Aug 2011 13:26:12 +0100 Message-ID: To: Sebastian Bergmann Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] ReflectionClass::newInstanceWithoutConstructor() From: rquadling@gmail.com (Richard Quadling) On 25 August 2011 10:46, Sebastian Bergmann wrote: > =C2=A0I have attached a patch to https://bugs.php.net/bug.php?id=3D55490 = that > =C2=A0implements ReflectionClass::newInstanceWithoutConstructor() to crea= te an > =C2=A0object a class without invoking the constructor. > > =C2=A0As there are certain internal classes that would "crash" when their > =C2=A0constructor is not invoked, this new method of the Reflection API o= nly > =C2=A0works for userland-defined classes. > > =C2=A0Unless there are objections, I will commit this change to PHP_5_4 a= nd > =C2=A0trunk on Monday. I will add the method to the documentation as well= , of > =C2=A0course. Wouldn't ReflectionClass::newMockInstance() be a better name? What other use cases exists? --=20 Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea