3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MockReflectionMethod extends ReflectionFunctionAbstract { public static function export() { } public function __toString() { } } try { (new MockReflectionMethod)->isStatic(); } catch (Throwable $e) { echo "Caught Throwable: ", $e->getMessage(); } catch (Exception $e) { echo "Caught Exception: ", $e->getMessage(); } try { (new MockReflectionMethod)->getReturnType(); } catch (Throwable $e) { echo "Caught Throwable: ", $e->getMessage(); } catch (Exception $e) { echo "Caught Exception: ", $e->getMessage(); }
based on f20S1
Output for 7.1.0 - 7.2.0
Caught Throwable: Call to undefined method MockReflectionMethod::isStatic()Caught Throwable: Internal error: Failed to retrieve the reflection object
Output for 7.0.0 - 7.0.20
Caught Throwable: Call to undefined method MockReflectionMethod::isStatic() Fatal error: ReflectionFunctionAbstract::getReturnType(): Internal error: Failed to retrieve the reflection object in /in/9ScYT on line 25
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Call to undefined method MockReflectionMethod::isStatic() in /in/9ScYT on line 17
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/9ScYT on line 17
Process exited with code 255.