Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10546 invoked from network); 17 Aug 2016 16:44:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2016 16:44:05 -0000 Authentication-Results: pb1.pair.com header.from=aaron@trowski.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=aaron@trowski.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain trowski.com designates 199.38.81.6 as permitted sender) X-PHP-List-Original-Sender: aaron@trowski.com X-Host-Fingerprint: 199.38.81.6 mercury.negativeion.net Received: from [199.38.81.6] ([199.38.81.6:53930] helo=mercury.negativeion.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/2A-45465-35494B75 for ; Wed, 17 Aug 2016 12:44:03 -0400 Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 0B8AB3E8C2B7 for ; Wed, 17 Aug 2016 12:44:01 -0400 (EDT) X-Virus-Scanned: amavisd-new at negativeion.net Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cqLj2t4iJt0S for ; Wed, 17 Aug 2016 12:44:00 -0400 (EDT) Received: from [10.0.1.3] (unknown [192.119.134.23]) by mercury.negativeion.net (Postfix) with ESMTPSA id 7C9DC3E8C299 for ; Wed, 17 Aug 2016 12:44:00 -0400 (EDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_D1E00192-A709-4F8F-BC77-8827597F2D3A" Message-ID: <15E198DD-FF66-475D-ABBC-54ECD2B6BF62@trowski.com> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Date: Wed, 17 Aug 2016 11:44:00 -0500 References: <0668D584-EE51-4932-85D7-01D8BF70E409@trowski.com> To: internals In-Reply-To: X-Mailer: Apple Mail (2.3124) Subject: Re: [PHP-DEV] ReflectionType::__toString() prepending \ to class names From: aaron@trowski.com (Aaron Piotrowski) --Apple-Mail=_D1E00192-A709-4F8F-BC77-8827597F2D3A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Marco, > On Aug 17, 2016, at 11:22 AM, Marco Pivetta > wrote: >=20 > Sorry, I have to object here: this is quite a BC break for Zend\Code, = specifically. We will have to re-adjust the code generators to adapt to = the newly introduced prepended `\`. >=20 > In addition to that, there is no need for `\` to be prepended to a = type string, since inside string scope, we are always dealing with the = base namespace. >=20 > Seems unnecessary and causes a lot of headaches, instead of actually = simplifying things. >=20 > Marco Pivetta=20 >=20 > http://twitter.com/Ocramius =20 >=20 > http://ocramius.github.com/ >=20 Adjustments will be necessary in Zend\Code no matter what because of = nullable types. If a type is nullable, ReflectionType::__toString() will = return "?\Type\Name" or without the changes I committed it would return = "?Type\Name". If you need the type name without the leading ? or \, use = ReflectionNamedType::getName(). It would be nice to have no BC breaks, but right now I'm not seeing a = way of handling nullable types in ReflectionType::__toString() without = some sort of BC break. Aaron Piotrowski --Apple-Mail=_D1E00192-A709-4F8F-BC77-8827597F2D3A--