Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60081 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 724 invoked from network); 17 Apr 2012 14:55:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2012 14:55:01 -0000 Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.213.170 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:37871] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/A5-03996-1448D8F4 for ; Tue, 17 Apr 2012 10:54:59 -0400 Received: by yenl5 with SMTP id l5so3497383yen.29 for ; Tue, 17 Apr 2012 07:54:55 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=bAIhGwZubS8tW6YRz/k9xKRDG+lLXv3H1FfS/zE54IQ=; b=Ya5cBZGs7TgK094C70TE+0ZLsw0HNQupf1aiX+gIjnY92SzUVIxiUlWYdx2K4+icGI tg0+qZBJ2H7kj0Cso/oW6UN037jGHXz7OjMH1eeR1nsabdvS/2GUL4xxzQ6uZrbThOm7 rXcRKV2BgLdtoCQqZFrVG5iNr0u0pr9RdTkJ5nZsq4f1AAnUXSXz3bfVXiNTBftBmaDy KeaxKXUS1fhUF2hkWH6RI9Ig2l/Q0w5TjBpbFamRP4sox1D+Id9bNsyrnRoRXXKlMjI2 /GYW6yJ22yCCInhd7LCYXHl6KXFJ/1WMyfzcbEMVKKMwkgFWnIK3Z+6YEV0zM1oS1l9C IyNg== Received: by 10.60.29.10 with SMTP id f10mr21763955oeh.32.1334674495404; Tue, 17 Apr 2012 07:54:55 -0700 (PDT) Received: from ralph-mac.local (ip174-73-14-247.no.no.cox.net. [174.73.14.247]) by mx.google.com with ESMTPS id b6sm23271174obe.12.2012.04.17.07.54.53 (version=SSLv3 cipher=OTHER); Tue, 17 Apr 2012 07:54:54 -0700 (PDT) Message-ID: <4F8D843D.8070706@ralphschindler.com> Date: Tue, 17 Apr 2012 09:54:53 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Nikita Popov CC: internals References: <4F89D4F1.8070009@ralphschindler.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlAVWCC4HjKIfF9SHyMEeO8rykBMQhJGP1D7GkRZdJ9Kfx2pH+STBcn014oV1o7JFVAdFV9 Subject: Re: [PHP-DEV] New Feature: Fully qualified class name resolution as scalar with class keyword From: ralph@ralphschindler.com (Ralph Schindler) Hi Nikita, > A quick note on the patch: As the class name is compile-time > resolvable it should in my eyes also be available as a > `static_scalar`, so that it can be used in initialization lists: > > public function doFoo($withClass = ABC::class) { > new $withClass; // or whatever > } > > To be available as both a `static_scalar` and a general `scalar` one > should put the rule in the `common_scalar` section. > > What do you think? I've added this to the patch and Zend/tests: * https://github.com/ralphschindler/php-src/compare/master...feature/class-name-scalar I've also added an RFC page, any thoughts on improving the RFC? * https://wiki.php.net/rfc/class_name_scalars -ralph