Re: ReflectionType::__toString() prepending \ to class names

From: Date: Sun, 21 Aug 2016 16:01:42 +0000
Subject: Re: ReflectionType::__toString() prepending \ to class names
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.internals 
Request: Send a blank email to internals+get-95350@lists.php.net to get a copy of this message
Yes, but the __toString API is used for codegen, and current code generators don't expect a ? to appear there. How many engineers and failing unit tests does it take to explain a BC break? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Sun, Aug 21, 2016 at 6:00 PM, Levi Morrison <levim@php.net> wrote: > This is the ultimate point: if we don't prepend the question mark it will >>> break code. >>> >> >> This is the impedence here: ReflectionType is a >> *REFLECTION*, not a >> code generator. Don't think of >> ReflectionType#__toString() as a way to >> generate code: it is merely a string representation of the reflectoion. >> > > This is the last I have to say on anything: > > You just proved the point. It's a *reflection* of what was written. If > it's a nullable type then it needs a nullable reflection in the toString. >

« previous php.internals (#95350) next »