Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95414 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10927 invoked from network); 23 Aug 2016 14:50:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2016 14:50:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.181 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.216.181 mail-qt0-f181.google.com Received: from [209.85.216.181] ([209.85.216.181:35930] helo=mail-qt0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/10-10212-EB26CB75 for ; Tue, 23 Aug 2016 10:50:38 -0400 Received: by mail-qt0-f181.google.com with SMTP id 52so42117844qtq.3 for ; Tue, 23 Aug 2016 07:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=A9gwPs31UicKV+YX4eX7XKdi+WzzncAFsZOAQ8lRE0o=; b=GlIwuS/ig1FdEhs5CoytIX2t5fzn+iP3j08bCtRGMrlMxZwp/xM9AT+2iHsBtlTglu SfqYF5293vCOrJQXPgZIvciJvhcspmGzKuXvYe4dToxubHaHeOIf82N34dx531b61s9I 26ISqhcuIPojupiCSRwec+6JVTw1kH0Ub1HaXbTKntPLimJUwAhHF6x5QtNXw79Jf9u5 bqrFtRQeRlJWwaQApVG8KqHhmVarrDRcS29toojTLx81uQ8bE1802YrsrA5lHzv6FXc1 TnVHxHsB1r5PuIf9l13g5EyhF2aJK5VgyL4/qjQIJH3KNJb0ufyNQ6u6hZNu9kO7mFRF OHDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=A9gwPs31UicKV+YX4eX7XKdi+WzzncAFsZOAQ8lRE0o=; b=lk0TXfm+cmYnkwwvoM/d+PhBf3Yg2hEn3ZVSseoHyDAMuKxlZs109JnDQMSh29U5WI D7ZTOXPHwTQRY3CegaOCbPae7btX2uOJhrOWdu7QOwNNNMJFO+2OQC/Cm8ev66+i+XQ4 iie0HolWLTk/tpnjlrx7iHFd9mBnmtwnka9zeUsFi+9pw+73Em7oF7MZ3QdeWpxRFbi3 AYgarY6AVBxfxdgkFJ1OII2itOGvkZutZH5ocUmx0erJ9eEZccpq495767MYgs7tU3CQ B9lRw5ohSGQG46CkTbDruE7AQIaukbscMO4ph217SOTGDWGOEOS8c2VAw/r5G6ia/LCk 8whg== X-Gm-Message-State: AEkoouv7NVe+A1YsZSUQEDBXpasQ7sglIhChQQSZRs40vu1WsFAUgSVuqY7ICTshrzHdpn3XbWAg8Emhk0aKxw== X-Received: by 10.237.46.6 with SMTP id j6mr30448491qtd.113.1471963835318; Tue, 23 Aug 2016 07:50:35 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.140.93.72 with HTTP; Tue, 23 Aug 2016 07:49:54 -0700 (PDT) In-Reply-To: References: <031a2bf1-1996-1144-2b85-e10a40be9514@gmail.com> <7b81c830-1d05-a4ac-4713-1bb67cbec12c@gmx.de> Date: Tue, 23 Aug 2016 16:49:54 +0200 X-Google-Sender-Auth: oMT1B6LQjtDSjh4pNGj6WKcB_r8 Message-ID: To: Levi Morrison Cc: Alexander Lisachenko , "Christoph M. Becker" , Rowan Collins , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] BC break: ReflectionMethod::invoke() expects parameter1to be object, string given From: jpauli@php.net (Julien Pauli) On Tue, Aug 23, 2016 at 4:13 PM, Levi Morrison wrote: > On Tue, Aug 23, 2016 at 7:56 AM, Alexander Lisachenko > wrote: >> >> 2016-08-23 16:40 GMT+03:00 Julien Pauli : >>> >>> My patch allows that, but I can't find a use case to it. >> >> >> >> My use case for that was decorating of static methods with additional >> behaviour, so it's possible to cache the result of static methods, etc. >> Unfortunately, reflection API doesn't provide me such an ability, so I >> decided to switch to the combination of special closure with >> forward_static_call_array() and binding it to the desired scope. >> >> >> 2016-08-23 16:40 GMT+03:00 Julien Pauli : >>> >>> Try it. >> >> >> Yes, sure, I will check. However as I say earlier, now I use closure >> extraction and scope binding as more natural way to invoke such methods. So >> missing scope argument for static methods and ReflectionMethod->invoke() is >> a nice thing to have, but not a critical one. > > Seems to me you should be calling getClosure() and using > Closure::bindTo before invoking it. ReflectionMethod::invoke is really > just a short-cut for a common case; I don't think it's reasonable to > have it mirror the Closure API just to save one method call to get a > Closure. This cannot work. There is a special use case forbidding that. "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()" Julien