Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95410 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1643 invoked from network); 23 Aug 2016 13:40:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2016 13:40:02 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wm0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:34990] helo=mail-wm0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/17-49014-F225CB75 for ; Tue, 23 Aug 2016 09:40:01 -0400 Received: by mail-wm0-f45.google.com with SMTP id f65so163373199wmi.0 for ; Tue, 23 Aug 2016 06:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=MfM3SypOHphb1QopYK4iMC0Lls9LulXSKlGHdqrx5QM=; b=HLhkTooMlqg00GtrO9l66qKP2Lq8q4GD9ob/UiijiKYS3o7JHQU6FKUKMzQFuULunu wH2rhN18quCW5Bk9YrFzVCwUtwlLESqZKXDAGJpAXBZa/uDfDnk9j/MlAHxe/35TEGrQ VU9kJ8XqOBNGkBABd3L5FNiCivcY3mEE1S3K5PZPoOvi6aer8XOceJRBhIHu7KiROaX/ HP5DpHSWU68Gv13nKukWthiveqOZQ1FtCR7dqYzjJ8k6o+cy8sre0+Xx4CoLRUDLUinB TF3EMcjczGkeCaaj7kEmkSoBMdVXObcogFZbHKLw1OwUEUxJpuNQgwUMT/FyX925hvJk KUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=MfM3SypOHphb1QopYK4iMC0Lls9LulXSKlGHdqrx5QM=; b=AvFNaDlW/MQxNDQOZ9SEq/Z/+/31hHCDqWM0XnqsO2CAfxuFjIURuNGCB/ZRMnnl/U W+xLsELVELqzeFgAF5tVMY6gMSNwTAy8OV2EI3dS8bZQ9NKtBhve/67eQd5kvxGkqvNp OMLE6/tbzP/gpvI3bcq265EHSfTBfafQoGxYCR2aXG+XTuNj3nRZSbcK7wjotGphyf6D iGH/01gQ3uvMJqkNvn/XK5HZHHw3G7Dzy3e3nqij+oIEuqckORunIOWF7IcG0daMLZjV aM3eEavXkAMWYqe4XUIvsOhaj5eCk/JPDh2CICsqjyjJNDtOiKXH7CPOD7Dy6SBDcTY7 YgUQ== X-Gm-Message-State: AEkoouusKRco5NM1oTamklUJ2KX98ldX4dgDTUVT09VAlR/qS4SYxCdfzNRORpq9nu14HA== X-Received: by 10.28.16.3 with SMTP id 3mr20659643wmq.58.1471959596185; Tue, 23 Aug 2016 06:39:56 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id bj8sm3857625wjc.49.2016.08.23.06.39.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 06:39:55 -0700 (PDT) References: <031a2bf1-1996-1144-2b85-e10a40be9514@gmail.com> <7b81c830-1d05-a4ac-4713-1bb67cbec12c@gmx.de> To: "internals@lists.php.net" Message-ID: Date: Tue, 23 Aug 2016 14:37:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] BC break: ReflectionMethod::invoke() expects parameter1to be object, string given From: rowan.collins@gmail.com (Rowan Collins) On 23/08/2016 14:20, Alexander Lisachenko wrote: > > 2016-08-23 16:13 GMT+03:00 Julien Pauli >: > > > No, How can this be ? B extends A , not A extends B ... > In this case, B'sfoo() will be called , which is the equivalent to > having a reflectionMethod from B , so useless to me. > > > > Ok, how can I invoke Parent::whoami() with reflection and get exactly > "Child" as an output? I've no idea why you'd want to, but note that using get_class($this), you can actually get that for a non-static method: https://3v4l.org/Rc7Dk class MyParent { public function whoami() { echo get_class($this); } } class MyChild extends MyParent { public function whoami() { echo "Don't call me now!"; parent::whoami(); } } $m = new reflectionMethod('MyParent', 'whoami'); $m->invoke(new MyChild); So there is a gap in functionality between static and non-static methods here. I'm not sure reinterpreting a parameter which has always been ignored is the best way to solve it though. Regards, -- Rowan Collins [IMSoP]