Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95413 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7239 invoked from network); 23 Aug 2016 14:13:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2016 14:13:12 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.46 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.220.46 mail-pa0-f46.google.com Received: from [209.85.220.46] ([209.85.220.46:33521] helo=mail-pa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/00-07054-7F95CB75 for ; Tue, 23 Aug 2016 10:13:11 -0400 Received: by mail-pa0-f46.google.com with SMTP id ti13so48722968pac.0 for ; Tue, 23 Aug 2016 07:13:11 -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=eg6NkIeHmxzC6PZroigXHQU6BF7SY+3TZT7VesQuOzM=; b=c09y0tFCnv1MBugvLnspL2MgVrvHy9rNOakmbN5MRUEe/5PMXo03bJnoEqNhHXBDm1 LmZ2Xk72F5Fjx3vskGwUQdc2gSnsdPH2CMqSF/CZDrxLbkx5TiHwSiAT7PDXY4yiCFTp G7taS8qBNRgxn+XMFkKfv/x1rEf2TOnid4CSnXRGhL9drZ/KJaKDE1RAbb9Khcan1SbF ebFwVh/31L1/K6jCE2+fb3SnkIzLGozGRn4feKjwizc+gFxnVAMiIGjeDwO/bCI++mNi hxPYUOYUsmicbdj7AqhB2/9j+paoVHbLcWUBGPbjhbT35GbQ2/FHU4pMslcLOm7c3eVQ +vlg== 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=eg6NkIeHmxzC6PZroigXHQU6BF7SY+3TZT7VesQuOzM=; b=dCrLqDbrO+uvxXT/8TEg/mfeaf1PQ5ww1nhqxwCC8JgNy0egCnWIIVXMVKBEe1w85/ q/C/1J8N5KtaFS5423rVe9+3aP7NXN2+4U8XmlR6pcXYuE6WSiYbXL1UXJJRFParh8aJ XbFbl+e16090dfT96YWJDdrK2Uzt3k5VnbpwqEHeI/en30RgBp+AdaedOF0Rj/esiUqz Mm4vmLhRN7zOWZ0YObA6YAn5Qgrqcmk33GOrDUWTE/dgMakqsJY3M52ZL9TSU/Oq2ijE NMKRRyua0AJ8DN36WGzFe/sp8Mm6c+dKTGiaLZNHk7xE/PAQjpJfREX73SpxgIE4wLli l5zg== X-Gm-Message-State: AEkoousbDMjllVyk73VNAXHLe2tmZMRKdRUIBhdKFmtAvS+ab8wHwZMs1rhf2r2PMU2Ip3pps0AushxbRlpYdw== X-Received: by 10.66.54.132 with SMTP id j4mr53325225pap.110.1471961588631; Tue, 23 Aug 2016 07:13:08 -0700 (PDT) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.66.24.42 with HTTP; Tue, 23 Aug 2016 07:13:07 -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 08:13:07 -0600 X-Google-Sender-Auth: o-psHFUz-w-TdZScTZLAwzwlRk0 Message-ID: To: Alexander Lisachenko Cc: Julien Pauli , "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: levim@php.net (Levi Morrison) 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.