shitbangsOP•

All of these are wrong because according to the documentation, ReflectionFunctionAbstract implements Reflector which contains public static function export. Yet, PHP >= 5.2 eats it like cake.

Enter HHVM which has invented new abstract methods so it breaks but with completely unexpected fatal errors. Also, "getAttributesRecursive" on a function?!

EDIT: breaks their own docs as well

11
[deleted]•

How about that new standard spec?

0
shitbangsOP•

It covers the language, not the extensions

6
ChoHag•

At least the exit code is consistent.

8
XMR1•

You know you are working with PHP when you have to be grateful for that.

11
datibbaw•

It looks broken alright; I've written a fix for this issue against master. If all is well the fix should be pushed within a few days :)

Update: the fix has been committed to master.

3
shitbangsOP•

Compiling... I'm curious if this breaks my class. Although I haven't yet written the unit tests, we're dealing with a compile-time fatal error.

I've found one other instance of extending ReflectionFunctionAbstract on GitHub that's not simply a bunch of stubs to aid code completion. DISREGARD THAT I SUCKS C~

1
datibbaw•

Well, if you relied on the current behaviour of chugging on no matter what, then yeah, it will break with a nice friendly fatal error.

2
[deleted]•

[deleted]

1
[deleted]•

[deleted]

1
Grzechooo•

Well, at least HHVM guys will try fixing this. You bet your ass upstream "developers" would mark this as WONTFIX and go f yourself

0†
fred_emmott•

Actually, this is already fixed in HHVM master :)

cat test.php
<?php
class C extends ReflectionFunctionAbstract{
public function __toString()
{
return $this->export($this->name, true);
}
}

var_dump((new C()));
[fredemmott@devbig076 ~] hhvm test.php
object(C)#1 (1) {
  ["params":"ReflectionFunctionAbstract":private]=>
  NULL
}
[fredemmott@devbig076 ~] hhvm --version
HipHop VM 3.3.0-dev (dbg)
Compiler: heads/master-0-g8c2397074a60f22879d407c5c31b2f0cc7d6bb84
Repo schema: 99dedcc44e5b93b23c344149e8bb8370f076e166

Extension API: 20140702
2
datibbaw•

IMO that should raise a fatal error:

Class C contains 1 abstract method and must therefore be declared abstract or implement the 
remaining methods (Reflector::export).
2
riking27•

Yeah, dattibaw is correct - this is the wrong fix.

Concrete children of ReflectionFunctionAbstract should require both the toString and export methods.

1