Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46465 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45339 invoked from network); 18 Dec 2009 01:50:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2009 01:50:34 -0000 Authentication-Results: pb1.pair.com header.from=tstarling@wikimedia.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=tstarling@wikimedia.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain wikimedia.org from 66.111.4.25 cause and error) X-PHP-List-Original-Sender: tstarling@wikimedia.org X-Host-Fingerprint: 66.111.4.25 out1.smtp.messagingengine.com Received: from [66.111.4.25] ([66.111.4.25:54937] helo=out1.smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/10-44737-9EFDA2B4 for ; Thu, 17 Dec 2009 20:50:33 -0500 Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id D498EC590E; Thu, 17 Dec 2009 20:50:30 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 17 Dec 2009 20:50:30 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=wl6ZHZT9sWwhn4Cj4B+IbcS4nvg=; b=Z8EWu2JZsaHyG9LET3TeJ2mwavNuedp1E+gaIx9iRtrHc3D/p0L7JGYmLNVZgVLZU+hE5eoE0/YWMeiYSuCe7ODTFS5Hdz6SUIJ04wEUHgXLrp3wXXmslZFFe2azlJ/74wSGY/U+gKTu8sD1KxiUxeSsk6SoF1P4EK08//Moi6A= X-Sasl-enc: gmLK2bC6pmBV7jg6Lho49m+AFh0/iJuQHqfXlOGqwWl8 1261101030 Received: from [10.0.0.2] (CPE-124-176-96-118.lns3.ken.bigpond.net.au [124.176.96.118]) by mail.messagingengine.com (Postfix) with ESMTPSA id 80D9A73AD3; Thu, 17 Dec 2009 20:50:29 -0500 (EST) Message-ID: <4B2ADFE2.8020900@wikimedia.org> Date: Fri, 18 Dec 2009 12:50:26 +1100 User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Stanislav Malyshev CC: PHP Developers Mailing List , Stefan Esser References: <4B2027FF.3050704@wikimedia.org> <4B202EE0.4020007@zend.com> <4B299B97.4040606@wikimedia.org> <4B2A865D.4090606@zend.com> In-Reply-To: <4B2A865D.4090606@zend.com> X-Enigmail-Version: 0.95.7 OpenPGP: id=BF976370 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 5.3.1 reference parameter regression From: tstarling@wikimedia.org (Tim Starling) Stanislav Malyshev wrote: > > Tim, could you check if the attached patch solves your problem? > Yes, it works for me, in both the isolated test case and the original MW bug. MW's parser test suite shows 4 failing tests in 5.3.1, all fixed with this patch and no new regressions. Stefan Esser wrote: > just for the record: why does MediaWiki rely on a feature > "Call-Time-Pass-By-Reference" that is deprecated since PHP 4.0.0 <- > Yes exactly 4.0.0 The underlying functions are declared with reference parameters, and we call them with call_user_func_array() so explicitly creating references on the caller side is required. If you have a better method for calling arbitrary functions that accept reference parameters, let me know. Lots of MediaWiki functions are declared with reference parameters for objects when they aren't really needed, because that was the required convention in PHP 4, and we never made a concerted effort to remove all the ampersands. It's too late to fix it now, in many cases, because many extensions declare hook functions with reference parameters, following the caller and documentation that dates from PHP 4, and so we have to keep passing them reference parameters to avoid breaking them in PHP 5.3+. So the window for easy migration to value parameters has closed. -- Tim Starling