Nikita Popov
Nikita Popov
What is the use-case for `instanceof MyTrait`? This seems like a code-smell indicating trait misuse.
In that case, would it also be possible to use `class Foo implements FooTrait`? I.e. use the trait as an interface. (Basically making a trait an interface with default implementation)?
Not what I meant there -- rather you'd just get an interface with the trait methods. I.e. replace `trait Foo implements IFoo` with `Foo` acting both as trait and interface....
Another aspect to consider is how this interacts with trait conflict resolution. E.g. you can't do something like ``` php interface I1 { function method(Sig1 $x); } interface I2 {...
I'm generally open to the idea -- what do you want to use this for?
The core problem here is that there is no place to put these comments. We do retain comments in cases like ``` if ($x) { // comment } ``` by...
There is no option for this, but it should be easy to implement your own. Extend the standard pretty printer and override this method: https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L582 Rather than pMaybeMultiline call pCommaSeparatedMultiline...
> So, if we change the definition of null to be a pointer to block with id=0 instead of any pointer whose address is 0x0 I don't understand what this...
> > > So, if we change the definition of null to be a pointer to block with id=0 instead of any pointer whose address is 0x0 > > >...
> True, I just checked it. But the last example still fails: > > ```llvm > define ptr @src(ptr %in) { > %c = icmp eq ptr %in, null >...