3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); }
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Caught Throwable: Internal error: Failed to retrieve the reflection objectCaught Throwable: Internal error: Failed to retrieve the reflection object
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
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.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Call to undefined method MockReflectionMethod::isStatic() in /in/9ScYT on line 17
Process exited with code 255.

preferences:
198.67 ms | 402 KiB | 257 Q