Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95378 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2427 invoked from network); 22 Aug 2016 14:41:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Aug 2016 14:41:04 -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.48 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wm0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:37740] helo=mail-wm0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/B0-33251-FFE0BB75 for ; Mon, 22 Aug 2016 10:41:03 -0400 Received: by mail-wm0-f48.google.com with SMTP id i5so148319750wmg.0 for ; Mon, 22 Aug 2016 07:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=iORWuTlLWffddMu0c4K5BmPLbLykjuyS1XQnO94/mxs=; b=SKE+AtL/mdz5zJoJcZZuOAY3nwSckkhb4yhhJk6mDGB3T6PwG8ypft/ns1M6YlUTm7 LrtxvPYVxEBrpGCuonHUlTAqec+M/AKi2/5otiEHDHLOdBVXUKmxiknJxU+6OSY/pR+s RfYCkvAfLgCCh4UTbMKPZ4vQNNERWU1p9ZO89f5CuHF+Rm62OCMWPU938lLt5K0I/QxD pdsR1GrqpHAxKC7KgQkgb4binUB6l9VRPT/5RJ2kK4wLKpqivYiAlo96MkdwTHB+ED/M 2wBy5TSugp00N6YiuWyqvNR+RcLauzR7FXIqcDuoAdjWvPAH7ei66A6CPReUZvcQKL9F 1dvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=iORWuTlLWffddMu0c4K5BmPLbLykjuyS1XQnO94/mxs=; b=S2Hb7h54/ItW7lj8x+7xdAezAoH00FIek5/EgbA2mDmg/FAmsctAhY+Zc4XW8v1haF 2QG7ZYlLJqCrh8tD8LndH8KvMIqq238ZlKLHOZwT307cNfTh9gIj90re2UHoYN4YH3F5 Y8n0RiY+MkgY2UwK81k1LMgO0F56t5PpMToEcsNKjIHBppfzy6J3k/HmnYLG54iaamEe mbW3RRbnZoYT3NV7jx1u2iaotLHHWt33jw1u7xwRcMSqj50OHaKyAB0m9Q6L2OqPAohM 3XDTKl6kv5nQuyQAwKyU2TNTIrCHSinRHifXZ1sXXmoYd0QkO5NYT69rOUUKcOfYltuU MlNw== X-Gm-Message-State: AEkoouuFx+pBL9NCoiC5CAtFPFIgC5BJ34ZM4E7IdPhZlez+3+ynr66qYwuYzl47G4letA== X-Received: by 10.28.60.136 with SMTP id j130mr16712199wma.93.1471876860293; Mon, 22 Aug 2016 07:41:00 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id p4sm24443200wjq.27.2016.08.22.07.40.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2016 07:40:59 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <0b8ebd55-976b-f3a9-9f70-de392f2bd8e6@gmail.com> Date: Mon, 22 Aug 2016 15:38:36 +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 parameter 1 to be object, string given From: rowan.collins@gmail.com (Rowan Collins) On 22/08/2016 12:17, Nicolas Grekas wrote: > in ReflectionMethod::invoke(): > > the method doesn't accept a string as first argument anymore, see e.g.: > > https://3v4l.org/pImmv To be precise, in prior versions, the first argument was completely ignored for static methods: https://3v4l.org/8o4Hm $m->invoke('some_other_class_name', 'baz'); // Warns in 7.1.0beta3, ignores everywhere else $m->invoke(42, 'baz'); // Warns in 7.1.0beta3, ignores everywhere else $m->invoke(new DateTime, 'baz'); // OK in all versions $m->invoke($m, 'baz'); // OK in all versions It is still ignored if it is a valid object, so the current beta's behaviour doesn't actually make a lot of sense. The most logical would be for it to fail on any value other than null, since for a non-static method any other object will give "Given object is not an instance of the class this method was declared in" (except in HHVM, which just invokes on whatever object you give it): https://3v4l.org/sCFcA However, simply documenting that "the first argument is ignored for static methods", and removing the parameter validation, would probably be sensible for BC if there is likely to be real-world code passing something other than null. Regards, -- Rowan Collins [IMSoP]