Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93351 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93796 invoked from network); 16 May 2016 08:40:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2016 08:40:45 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.48 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.48 mail-lf0-f48.google.com Received: from [209.85.215.48] ([209.85.215.48:36253] helo=mail-lf0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/13-65275-C8789375 for ; Mon, 16 May 2016 04:40:44 -0400 Received: by mail-lf0-f48.google.com with SMTP id u64so114308964lff.3 for ; Mon, 16 May 2016 01:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=gwSfHWEemP4WBxe8o7RJXXRpj7GB9/frpM1F6+y6yMY=; b=qPppkj5zaJvHKDyXxjWLCkUl/HVE66Ekc/dimmK3lgHDJGE8Z5FECdypt6QZ3+OGyu GqSdZ7MOUmjh8NuD9l3r2ogSB7TRgfO5+1mhP1tC5jW9n3XOvb4J/Jr8yVrpyZP3/Flc 2LZ8Jx0B0mmitZp/6SYqBKDs19oR719vHJ84WCz3LUfMjvHvR33AEHbK8mFxHDBHh3eF n8so46FhEBrBcuFDSzg/RKl/Y3JS+/u2DOGg5AZ3dTj0KV46LV3Gw6a+C+b3WFkB4pdR f5q0e/ZnWikdGuNwrIdva7OuCs/NNswCUA7CqzphcEVMgIsC/MbvcbZFZe0nue4g/jJP JHag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=gwSfHWEemP4WBxe8o7RJXXRpj7GB9/frpM1F6+y6yMY=; b=LLowPHZ+zc5qaKF/U88SOJamVtaVE2CpSL2/EFLtkBbGzZcTE2g5z28GPvX2lOkNN3 hpOtJmrrZZA3yPi2qh9zootqwpDJdP72r0twoKCPvdg3Sx9xv37UdT5IX8qecKChaXkN omC40gYQNpAVR7TWm9oveNfNnuxiftNcWREdoRkzVllslL/7o17Ml/aVb45QdNeY8diK nw5U4IniMguxt4SiX+2LN+qj+sfzwwL4yk48PbvyhjorHi7/4vaN8Xp8aMr1TAJ6f1IX CUh4uk/dukGw+jmDE0yl+paieFIDGlFOa/cfACdSFyD7RamhU8bCwrElmKdYri8MuPPi EzCQ== X-Gm-Message-State: AOPr4FXnRIicIljmvo6uc8m3TldG4anNrnBzs1hZg9MgFYI4kQ8wGLIzejY0cj6UAq2Fdw== X-Received: by 10.25.136.137 with SMTP id k131mr11101390lfd.88.1463388041623; Mon, 16 May 2016 01:40:41 -0700 (PDT) Received: from nikita-pc (broadband-95-84-234-130.nationalcablenetworks.ru. [95.84.234.130]) by smtp.gmail.com with ESMTPSA id 31sm4905560lfu.48.2016.05.16.01.40.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 May 2016 01:40:40 -0700 (PDT) Content-Type: text/plain; charset=koi8-r; format=flowed; delsp=yes To: "Sara Golemon" References: <44BB42FB-4991-4531-827D-AF6A97B2675B@gmail.com> Date: Mon, 16 May 2016 11:40:42 +0300 Cc: "internals@lists.php.net" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/12.17 (Win32) Subject: Re: [PHP-DEV] [RFC][VOTE] Closure from callable From: inefedor@gmail.com ("Nikita Nefedov") On Mon, 16 May 2016 03:56:38 +0300, Sara Golemon wrote: > On Sun, May 15, 2016 at 11:20 AM, Nikita Nefedov > wrote: >> why would you need to support a $this->fieldName case though? >> > Because to not support it would be to deliberately design in a new > flavor of inconsistency into the language. $obj->memb is a property > access in PHP. Making it suddenly mean "method" is a significant > change (and one which belongs in a major version if at all). > > -Sara The whole idea is not in the syntax here, but in the notion that this access can only be static (so there'd be no way to do `$cb = [$this, "methodName"]; callable($cb)` - you'd have to call `Closure::fromCallable($cb)` instead). If you don't like the fact that `$obj->methodName` looks like a field access then there are ways around this. Because we still need a static way of exporting function references (whether it'd be as a closure or array). Other proposals were using `$obj->method::FUNCTION` syntax or something similar for example...