Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100899 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30150 invoked from network); 14 Oct 2017 11:00:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2017 11:00:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.220 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.220 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.220] ([81.169.146.220:23071] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/41-11059-A3EE1E95 for ; Sat, 14 Oct 2017 07:00:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1507978802; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=vnVGlvCHVV/U3YceMLpFPynrDOQ7K6eE2lYihON2U8w=; b=i20CvecEF8d4tViL3nzgxxFum6ETEW9AwvsBqe1S9RS4z8prH59G1gDVqhXM8Glbvy mzpP3r7aGwk2Jfbjc84Z8GGDzFM/myGsXmJWci4J16FiCS8FhGx7+Fzteje+sA4Jmurz UZWlEGRBpq4aw42DXm7GbTnC087QLzpu8H90Y= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8AaBAcZiAvcA== X-RZG-CLASS-ID: mo00 Received: by mail-qt0-f173.google.com with SMTP id z28so21388941qtz.13 for ; Sat, 14 Oct 2017 04:00:02 -0700 (PDT) X-Gm-Message-State: AMCzsaX9yeGhzXCRDZj5aBXZg5zstEzR5M8mWFMQLlWYo3ZMFpqABlik SHjvZzl/kqm0dO5iaVuc02rFXnXOU3spB/jz+ak= X-Google-Smtp-Source: AOwi7QArPmmyU32CSGWX/jb20XM1YN+b29p7EC3dNPQ7smd6Owh0fai/xtsZi3R0rczhFFVVvRcgRIZhG8OLbBXbt7Y= X-Received: by 10.37.210.199 with SMTP id j190mr2521302ybg.424.1507978801688; Sat, 14 Oct 2017 04:00:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.37.130 with HTTP; Sat, 14 Oct 2017 04:00:01 -0700 (PDT) In-Reply-To: References: Date: Sat, 14 Oct 2017 13:00:01 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary="94eb2c065a58cdb74c055b7fac56" Subject: Re: [PHP-DEV] Re: Suggestion Method Constant From: me@kelunik.com (Niklas Keller) --94eb2c065a58cdb74c055b7fac56 Content-Type: text/plain; charset="UTF-8" > > Hi Mathias, > > > Mathias Grimm wrote: > >> I would like to suggest a method constant that could be used the same way >> we use the ::class one >> >> I don't have a strong personal preference but it could be something like: >> >> MyController::myActionMethod::method, no sure about the internals but it >> would be consistent with the one for the class. >> >> Cheers, >> >> > I've long wanted to make constant lookups fall back to a closure of the > correspondingly-named function, where one exists. so `strlen` would resolve > to a closure of strlen(). > > Thing is that classes are weird. We sort of have three different things > with sometimes-similar syntax: constants, methods and properties. foo::bar > is a constant, foo::bar() is a function, $foo->bar() is a function, but > $foo->bar is not a constant. So, if I want $foo->bar to resolve to a > method, then $foo::$bar should too, even though that makes no sense. The > PHP static property syntax is the bane of my existence. Please no fallbacks, thanks. It was already a mistake for namespaced functions. Regards, Niklas --94eb2c065a58cdb74c055b7fac56--