Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95408 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95751 invoked from network); 23 Aug 2016 13:13:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2016 13:13:58 -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.54 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wm0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:36809] helo=mail-wm0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/F5-49014-61C4CB75 for ; Tue, 23 Aug 2016 09:13:58 -0400 Received: by mail-wm0-f54.google.com with SMTP id q128so162918459wma.1 for ; Tue, 23 Aug 2016 06:13:58 -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=mwVw/oHF3okzxOnJO3IGAsckf1jqSJwnjwvSybAUUkc=; b=0qfLSo3DsRIZIAxlcq6Oj2I+iY7y/mXkxJGL67HOIFa10cNGC6m3SRa5Ouo+Y+MWwf ZMk6AHWn3qLfb+t60j32I5MtQcZHmHXPCt8yDjFqbIhj/TwQ+WEsUKAG0O4qdBuVxdmZ rB7b7yuUryON2BPF4/7eBjRoyztlHRgSJRr8XJFOi/78O5kwq9RIGCq5XZOZqBnMZXPL yM4tsM0rgxtsJ5ehg1sIQZ9pF5h6o6mxIme53vcDAKNIOSJrv34Z0CdSzhdlvXWZ4y60 nAhbYKsINXJEQPVRg9ELekrpCFPqgAdIaZjsAZl5lFowO+GZRGU8kej5zIz+mX46dZ7h 16ig== 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=mwVw/oHF3okzxOnJO3IGAsckf1jqSJwnjwvSybAUUkc=; b=C+Mpu5B1bTEUIBeDhwE/79wriAdM9zOcRsbOUwOPUNHp3iko4E0HFfc4095gP+pSNf Z+oRqIrVtW8rKNIh3rT5qC5A2wSBbaV2luBG/lkjDHDpOsxzefWHqMfbO1AtpN28cSE5 M9jgVoQLavRBr8JbRP6sOu1p8AF1rGbH7S+p8aL0d7uZw1LJaF4z3auksM+qh0QqRBLm 5KSD5YTQHBNiLGEZMGO1y+I1X6TemIQncJJ3b2js2gESuePRPZ3xM+nOYe1rsPly51Jg WLFwvgWm8lS4Cdbog2C90nS9TTGoTXy11krVZKHdEX3/+qCU/wSRy4lerECAtK1+voau sn9Q== X-Gm-Message-State: AEkoouu+Lc5X2UWgN6hDOX6uRokqdLF6CsJaZg9ueHfavI6NggEcha7gU/lPj1Y+xyFs3Q== X-Received: by 10.28.189.195 with SMTP id n186mr21368461wmf.106.1471958035437; Tue, 23 Aug 2016 06:13:55 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id q23sm4389315wme.17.2016.08.23.06.13.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 06:13:53 -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:11:25 +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 13:56, Alexander Lisachenko wrote: > For static methods this could be object (why not - it will be ignored) Allowing a parameter and then completely ignoring it is what got us into this situation in the first place. Why does this... $a = new reflectionMethod('A', 'foo'); $a->invoke(new DateTime); ...make any more sense than this? $a = new reflectionMethod('A', 'foo'); $a->invoke(42); If you want to allow an object to be passed in, it should act the same way as a string - specify the binding context: $a = new reflectionMethod('A', 'foo'); $a->invoke(new B); // equivalent to $a->invoke('B'); It should also go through the same check as it would for a non-static method: must be an instance of the class being reflected. Regards, -- Rowan Collins [IMSoP]