Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33090 invoked from network); 31 Jul 2013 13:14:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2013 13:14:38 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.169 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.128.169 mail-ve0-f169.google.com Received: from [209.85.128.169] ([209.85.128.169:48271] helo=mail-ve0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/73-07795-CBD09F15 for ; Wed, 31 Jul 2013 09:14:37 -0400 Received: by mail-ve0-f169.google.com with SMTP id db10so726065veb.0 for ; Wed, 31 Jul 2013 06:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=8ZBdiKwh8Rl5A9u3j5fNaweIoqLeXeymRtdXpW/pCYE=; b=J3DfDVSYJ6AkcHIR7OccfW5s9GPEEt3jIcMrxZyXKTmHANGvSHTg4AiwNuqVB4gDxe DRKsWo3uVgj0+h44muC2Osk43KluxFRhEAT+2Ob/Wk0sqhubnuIYbGTM8PTDpRPPXN0h y0L9cfwTy6sDgGUXHJP53J/iU0NHrd/0iLkokxHG8LN3pss+Btpk1dK4rvl/MXrKuaIS XcYmRKRQhq0cihNshDDjSn7DOqMKR/4FGzDM0NFOreqd+LUA4imCxB9Mljd3/ATdelWN mTOUipPgBDSre1h9rqj+pq1+w1eZxplFyYYjEPLSu5o4eow/8FWft3jaPQ0mU6ORj/Do 3BIQ== X-Received: by 10.58.182.103 with SMTP id ed7mr29239671vec.70.1375276474176; Wed, 31 Jul 2013 06:14:34 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.142.12 with HTTP; Wed, 31 Jul 2013 06:13:54 -0700 (PDT) Date: Wed, 31 Jul 2013 15:13:54 +0200 X-Google-Sender-Auth: ZMdwk_-7qgUl4nZFc92enDDwypY Message-ID: To: PHP Internals , Dmitry Stogov , Laruence Content-Type: multipart/alternative; boundary=047d7b676e1cb61aef04e2ce811b Subject: Adding \Closure::isBindable() From: jpauli@php.net (Julien Pauli) --047d7b676e1cb61aef04e2ce811b Content-Type: text/plain; charset=ISO-8859-1 Hi all. From a recent discussion, we noticed that there is no easy user-level way to know if a given closure is bindable or not. Sure, the debatte about https://bugs.php.net/bug.php?id=64761 is still open, I dont see why a static closure is not bindable, knowing that a global scope defined closure is, and it can contain $this. I'm feeling like there is a non sense in this design, but anyway. To prevent such code : https://github.com/atoum/atoum/blob/master/classes/test/adapter/invoker.php#L191 , I added \closure::isbindable(). It's at https://github.com/jpauli/php-src/compare/static-closures , if you have thoughts ? Julien.Pauli --047d7b676e1cb61aef04e2ce811b--