3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyMethod extends \ReflectionMethod { public function hasPrototype() { try { parent::getPrototype(); return true; } catch (\ReflectionException $e) { return false; } } public function getPrototype() { return $this->hasPrototype() ? parent::getPrototype() : "Method {$this->getName()} does not have a prototype"; } }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of MyMethod::getPrototype() should either be compatible with ReflectionMethod::getPrototype(): ReflectionMethod, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/Oi9NJ on line 15 Fatal error: Declaration of MyMethod::hasPrototype() must be compatible with ReflectionMethod::hasPrototype(): bool in /in/Oi9NJ on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.94 ms | 401 KiB | 8 Q