Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90726 invoked from network); 16 May 2016 08:31:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2016 08:31:31 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 157.56.111.115 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 157.56.111.115 mail-bn1bon0115.outbound.protection.outlook.com Received: from [157.56.111.115] ([157.56.111.115:35616] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/62-65275-F5589375 for ; Mon, 16 May 2016 04:31:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rMgFFwD45LcEqQ3pw3CKQoyziLumhoNNIYaaOE3frAM=; b=jjPJydLQsyNLwGdD+wp4YqM/vQfCNPqF0r4Eo4mZN5E6i65XSbFZGWtxPwrDEjxBvIbZ7rmfXbxXmc1frjDtlZGU2s00VDyYkVlJDVOtoxGBiLoWkio4Xm3cF4JjwvevDuwIU714rhP73jzgEadTFsaS3MVfeQamaHBBK5DHr8g= Received: from CY1PR0201MB1786.namprd02.prod.outlook.com (10.163.55.19) by CY1PR0201MB1788.namprd02.prod.outlook.com (10.163.55.21) with Microsoft SMTP Server (TLS) id 15.1.497.12; Mon, 16 May 2016 08:31:23 +0000 Received: from CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) by CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) with mapi id 15.01.0497.017; Mon, 16 May 2016 08:31:23 +0000 To: Dan Ackroyd , "internals@lists.php.net" Thread-Topic: [PHP-DEV] [RFC][VOTE] Closure from callable Thread-Index: AQHRrs94vEUA0EmG9kusUwZkqMJhqp+7O91X Date: Mon, 16 May 2016 08:31:22 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: basereality.com; dkim=none (message not signed) header.d=none;basereality.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: 6287026c-973f-4e70-d01d-08d37d6476c6 x-microsoft-exchange-diagnostics: 1;CY1PR0201MB1788;5:IKqQXjvbJIiiEk6TjFRRSJLVfo3WIfdepcj32Lm+4huw9rrjK5Jyxw9h/+EKh5fWd7n/crP366/DHinWOhMkY5RDVZwO0rPCjikNPVo7fy30JI1C0ojMesXQQH9Af8l3DrrA7MdixG3saErariZ07Q==;24:LQ3/NmE4mE9nrydjvmob61l8yWPK8C1d+F14kSViWgNXNJQ3SxGEojZ+Q4N0qiE94mjisdIDFpLn1jmFb04IUWKnHGRfVZ1aP5MCwSmqhfw=;7:K4cT160cWuKiu3A0v9Hr/0HoeOaFF199tftLAU5K7f9tNaVewS5Nnxqv38heV0dqy31nMH2oWcd2fAK9adoEEH5V7Lm7F/3yF/FwqE3cdTbYmWKoGI2q1tCWS+tSWWjyBxtwZ0tKhklzz+TZm9EORzF1ark2VfbV7AJSvtE7f00cQ+mohYCfe/2eDOjEciu6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1788; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:CY1PR0201MB1788;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1788; x-forefront-prvs: 09443CAA7E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(54356999)(76176999)(50986999)(86362001)(3846002)(5001770100001)(3660700001)(11100500001)(76576001)(2906002)(107886002)(74316001)(586003)(66066001)(106116001)(33656002)(99286002)(122556002)(5002640100001)(5003600100002)(87936001)(189998001)(10400500002)(2950100001)(9686002)(2900100001)(92566002)(15975445007)(77096005)(15188155005)(3280700002)(6116002)(1220700001)(102836003)(5004730100002)(8936002)(81166006)(16799955002)(19580405001)(19580395003)(2501003)(8676002)(5008740100001)(556834004);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0201MB1788;H:CY1PR0201MB1786.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2016 08:31:22.9345 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1788 Subject: Re: [PHP-DEV] [RFC][VOTE] Closure from callable From: dmitry@zend.com (Dmitry Stogov) I'm sorry, I didn't follow the RFC discussion. In general I like the idea, but why not to use Closure constructor? $f =3D new Closure("some_func"); would look more readable than $f =3D Closure::fromCallable("some_func"); Sorry, if this was already discussed before. Thanks. Dmitry. ________________________________________ From: Dan Ackroyd Sent: Sunday, May 15, 2016 8:29:22 PM To: internals@lists.php.net Subject: [PHP-DEV] [RFC][VOTE] Closure from callable Hello, I've opened the voting for the Closure from callable RFC - https://wiki.php.net/rfc/closurefromcallable Just to note, some people I've spoken to have expressed a desire to have a more powerful syntax where 'bare' function names are used, like: callable(someFunctionName) callable($this->method) I fully agree with those people, however I can't see anyway to do that before PHP 8. It would almost certainly need some clean up of the allowed syntax to disambiguate what `$this->method` means for: class Foo { public $method; public function method() { } } Leaving that top-level function name available for future versions, where we might be able to support it properly, is one of the reasons to use the more verbose function name. cheers Dan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php