Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62902 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9906 invoked from network); 8 Sep 2012 05:12:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2012 05:12:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.214.170 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:45119] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/72-27788-CC3DA405 for ; Sat, 08 Sep 2012 01:12:45 -0400 Received: by obbwc18 with SMTP id wc18so549756obb.29 for ; Fri, 07 Sep 2012 22:12:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=5eAXNXhm6oc8eb1YzOkMJ6PKKIJDu+H9I1BvuK4YJJw=; b=fPU8y+Yr6O57IjHq9AbaabLMY2STMTk3rvcClen7bvIHvdJo4WalL33gQppOMsD9mm NqE1Ytv/4P2bey04izjzD2nORwvfw5GQ9N14IuuzN6HOtGvNAYEnJMke0tzeC6VVMLj3 9oZWhAL9LmMZtMqfB4hjOLARTFA1UH82m+ozlxZ/Gwk0c3fBhqka5GZJpTCYj0ZY/fBd mxhRnDlxtlyp1OMPnQP9lRzoyA+v25hvLO66bMvkS5xaNLhb0bjvdn3MjEiM/rMxy/fz tIdSN9UB8fR+tnejbU+odBQ+VcWrey1Hj3fHTk0ne7Sqp6CIzkfVWyJkjYGag6VQ6SEI Zm1A== Received: by 10.182.124.102 with SMTP id mh6mr8046028obb.48.1347081162515; Fri, 07 Sep 2012 22:12:42 -0700 (PDT) Received: from Ralphs-Mac-Pro.local (ip174-73-14-247.no.no.cox.net. [174.73.14.247]) by mx.google.com with ESMTPS id bp7sm6673647obc.12.2012.09.07.22.12.41 (version=SSLv3 cipher=OTHER); Fri, 07 Sep 2012 22:12:41 -0700 (PDT) Message-ID: <504AD3C8.5090000@ralphschindler.com> Date: Sat, 08 Sep 2012 00:12:40 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: internals@lists.php.net References: <4F89D4F1.8070009@ralphschindler.com> <4F8CEB3B.4080702@ralphschindler.com> <4F8DA14F.1030204@sugarcrm.com> <4F8DCAC7.2050302@ralphschindler.com> <4F8DF2B6.4030709@sugarcrm.com> <4F8DFB17.7030509@sugarcrm.com> <4F8F1D0C.2030904@sugarcrm.com> In-Reply-To: <4F8F1D0C.2030904@sugarcrm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnBW6tQlx51+gSR9UrV2GYry7IZpU2qAuLktAgnP/2zfQ9ZUrICOVHUIEHAOVo2nGKvnoRc Subject: Re: [PHP-DEV] Re: New Feature: Fully qualified class name resolution as scalar with class keyword From: ralph@ralphschindler.com (Ralph Schindler) Hey Stas, et. al., I think I've addressed some of your concerns and completed this feature/patch. https://github.com/php/php-src/pull/187 More inline ... >> But yes, I agree that runtime resolution only duplicates existing >> behavior, so it isn't really necessary (you could argue thought that >> self::class similarly also only replicates the existing __CLASS__). It >> would be nice for consistency in my eyes, but I'm good without it too The current patch allows for the following: self::class -> resolves to name in active_class_entry static::class -> resolves to FCALL get_called_class() parent::class -> resolves to FCALL get_parent_class() I would have liked to have done parent::class w/o FCALL but the active_class_entry's parent is empty even when inside of a class extending another class. > $foo::bar and $foo::class mean completely different things. foo::bar is > static constant expression, so is foo::class, but static::class and > $foo::class won't be. It all would be very confusing. I suggest limiting $foo::class is not syntax that is currently handled (you will get a parse error: unexpected T_CLASS here. I think that is what you were ultimately suggesting, no? Feedback is welcome, either here or in the pull request. Thanks! Ralph