Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85858 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58597 invoked from network); 17 Apr 2015 20:04:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2015 20:04:22 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:37896] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/94-39957-34761355 for ; Fri, 17 Apr 2015 16:04:20 -0400 Received: by wiun10 with SMTP id n10so32259682wiu.1 for ; Fri, 17 Apr 2015 13:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=8sz9V8s5RZYD4ZfRpQCY0n6WIitnuZ3Z8Qloy9xDJIs=; b=0qWU5ggxDrsHwWeTyTvZSNTpFjnydOjpuqE7KvvFBT+Ynr/n5UgY1Dq9yZzK1E/7Zx pOV8NCWS0Wl5aCtbsk3K7sqnTxeqQ8vgAaDsU75K4w16Mtl7L9Vjg6AvGJWpUoR4nxXF Ma/OQJYlmaNsJKbv1yk3ETGwgV/7/SnHDjGBb3LK1kIvIV3oakWlbYAL5X7Zj/0f4H6x bsdG7d03aqAD3YEposeR/TIEwNmlw0nSR5dT9gNdsFwRvRgfosLmVEcJkq2f94Fzvv+7 8dZEvB4ov1pg+DxdF/Wr14uOA6G+Xbt32lUb0y6/54uXHEbRAvNQik9Ww/WF4yqt9A9Z wdYg== X-Received: by 10.194.93.195 with SMTP id cw3mr9124112wjb.150.1429301056748; Fri, 17 Apr 2015 13:04:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.48.198 with HTTP; Fri, 17 Apr 2015 13:03:56 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Apr 2015 22:03:56 +0200 Message-ID: To: Ferenc Kovacs Cc: Julien Pauli , Andrew Faulds , PHP Internals Content-Type: multipart/alternative; boundary=047d7bacbd48c3c4fe0513f11545 Subject: Re: [PHP-DEV] Closure::call() to access private data, really ? From: ocramius@gmail.com (Marco Pivetta) --047d7bacbd48c3c4fe0513f11545 Content-Type: text/plain; charset=UTF-8 On 17 April 2015 at 18:43, Ferenc Kovacs wrote: > For the record this isn't exclusive to Closure::call, afaik the same thing > is possible with Closure::bind() since 5.4 > http://3v4l.org/hlFS4 > And there are/were a decent amount of discussion (and AFAIR even hydrate > libraries using this trick) about this, for example: > > http://ocramius.github.io/blog/accessing-private-php-class-members-without-reflection/ > Also note that this is the only way to access private properties by-ref (yes, I do need that for my horrible use-cases. No, don't ask about it.) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --047d7bacbd48c3c4fe0513f11545--