Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86132 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72375 invoked from network); 7 May 2015 15:14:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2015 15:14:18 -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.178 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:34578] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/A2-53430-9418B455 for ; Thu, 07 May 2015 11:14:17 -0400 Received: by wicmx19 with SMTP id mx19so16255398wic.1 for ; Thu, 07 May 2015 08:14:14 -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=sD3U9SW0qrYfd9mPkDZp6blugz8Zmoep/5C5jQM3IaE=; b=gJyz2duQWUVp9UxmsbcbQ1LRrlmmIAHFJH/cUuB+sZhL9X+RP51rhQVXpzgqMNt2dS ZEK5bYwfoDFNskK3NQGWJRKUquQr6xeSR7Kckm3Ewe2TTZ5npiJen7spbJ7/5jK3V9CR mcg8WWwNbzySI9XC/mWwv95hcKO8mBk/OtX3dcMjIooMvry4uOurZcaXhRpcXaAaoq57 c2RqBSPtX5kPXsGqqEKNkJZM7vGn+edzcucQZcu/uBy6gc7+Ulp360So4b1jMm5vMQUI DuntTI8sluLc9kJ/6pFevCxjp2k5Trz0vYXD78oqFjXHLkfVkaHVjSjWkN/IWJ/SNIxM hgPQ== X-Received: by 10.194.118.135 with SMTP id km7mr8308822wjb.125.1431011654297; Thu, 07 May 2015 08:14:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.48.198 with HTTP; Thu, 7 May 2015 08:13:53 -0700 (PDT) In-Reply-To: <554B7EEE.6000701@ralphschindler.com> References: <554B7EEE.6000701@ralphschindler.com> Date: Thu, 7 May 2015 16:13:53 +0100 Message-ID: To: Ralph Schindler Cc: PHP Internals List Content-Type: multipart/alternative; boundary=089e0122838052efcc05157f5dee Subject: Re: [PHP-DEV] Add support $object::class From: ocramius@gmail.com (Marco Pivetta) --089e0122838052efcc05157f5dee Content-Type: text/plain; charset=UTF-8 On 7 May 2015 at 16:04, Ralph Schindler wrote: > > 2. Illogically - Bar::class valid syntax, $object::class invalid syntax. >>> >>> I'll grant you the consistency argument. I'm all for consistency, but >> that's the ONLY valid reason you've stated. >> > > Even then I think this part of the argument is fairly weak. In > Bar::class, the context of Bar is always a class name (either short due to > do namespace or use statements, or long fully qualified). > > $object is not guaranteed to be an object, it could be anything (int, > string, etc) or nothing (null). using ::class for a variable, I'd argue, > makes for less consistency. What would the replacement be for non-object > variables? An error, exception, or false, or string type? At least in > "Bar::class", you'll always get a string representation of what the fully > qualified class name resolves to. > Hey Ralph, Please refer to current behavior: http://3v4l.org/3sgLa Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --089e0122838052efcc05157f5dee--