3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace My\Reflection; 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 My\Reflection\MyMethod::getPrototype() should either be compatible with ReflectionMethod::getPrototype(): ReflectionMethod, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/Itm2f on line 16 Fatal error: Declaration of My\Reflection\MyMethod::hasPrototype() must be compatible with ReflectionMethod::hasPrototype(): bool in /in/Itm2f on line 6
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:
40.57 ms | 402 KiB | 8 Q