lolPHP *and* HHVM
3v4l.org/qDQa2Posted Aug 12, 2014, 12:30 PM UTC
Posted Aug 12, 2014, 12:30 PM UTC
At least the exit code is consistent.
You know you are working with PHP when you have to be grateful for that.
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.
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~
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.
[deleted]
[deleted]
Well, at least HHVM guys will try fixing this. You bet your ass upstream "developers" would mark this as WONTFIX and go f yourself
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
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).
Yeah, dattibaw is correct - this is the wrong fix.
Concrete children of ReflectionFunctionAbstract should require both the toString and export methods.
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
How about that new standard spec?
It covers the language, not the extensions