Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81116 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61924 invoked from network); 25 Jan 2015 09:16:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2015 09:16:30 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.170 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.170 mail-pd0-f170.google.com Received: from [209.85.192.170] ([209.85.192.170:43506] helo=mail-pd0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/93-36889-D64B4C45 for ; Sun, 25 Jan 2015 04:16:30 -0500 Received: by mail-pd0-f170.google.com with SMTP id p10so6389855pdj.1 for ; Sun, 25 Jan 2015 01:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=n0Q46VNGLwFrxkevMB8dZAXy45k8mfEXu7Doe/S3XjM=; b=ilSaZ3gviFoK9LPKdzvLAFuDgAaZ+5LviY7+t2ul9qY/LvKea8vTW2YUY7chgxDaPi hzwg3g98nU6y0N0fM3YfcsxBogy/NgPIhZnlpkt+ZjOIAK2d+sOEuaGAr0x92/cOi9S/ lMKKGkdsgBBQVp47rFJUe8HKWrO/+lJsVLMkr0KNz1x1JJ/cmr7CCsZtCkXU9wgOQayS Xf4D1Z7ptJqvGPDSz9g750UKvXT+tvHOnsZRDbSwPVFGRS5nuZU+ouJOipD3NfPCjleQ LK1k1gD0QCsbc/x9RnwLy+S3XIUz2DM5hObURLMnhHB8eDiE29crEknc4V02AaYBxD2C 2flQ== X-Received: by 10.68.65.103 with SMTP id w7mr25301208pbs.25.1422177386879; Sun, 25 Jan 2015 01:16:26 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id mt4sm6733072pdb.55.2015.01.25.01.16.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jan 2015 01:16:26 -0800 (PST) Message-ID: <54C4B467.3080200@gmail.com> Date: Sun, 25 Jan 2015 01:16:23 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Marc Bennewitz , internals@lists.php.net References: <52243BA6.5040905@sugarcrm.com> <54B6C047.3070301@mabe.berlin> In-Reply-To: <54B6C047.3070301@mabe.berlin> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > class Baz extends Bar { > function foo($a=default, $b=default) { > // do something > parent::foo($a, $b); > } > } I tried to implement this, however there's a major issue that I do not know how to overcome. The issue is that when we compile method foo() we do not know the default values. These values are stored in RECV_INIT opcodes directly, so when we find out what the actual values are - i.e. when we resolve inheritance for class Baz - it may be in runtime, so we'd have to update opcodes for RECV_INIT in foo() in runtime. Which is not going to sit well with opcode cache, which assumes opcodes do not change. I'm not sure yet how to solve this - since the values are only stored in the opcodes it is not easy to locate them in runtime, so even if we make 'default' zvals some special type we'd still have a problem finding the right value since the binding happens in runtime and we don't have now any place to store the result of that binding. I'll think a bit more about it, in the meantime any ideas about how to resolve this problem are welcome. -- Stas Malyshev smalyshev@gmail.com