3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { function myMethod() {} } class Foo extends ReflectionMethod { // Note: PHP never requires a child's constructor signature to match the parent's, so we don't need to sniff for that public function __construct() { parent::__construct('MyClass::myMethod'); } } $method = new Foo(); echo 'Signature 1 called in a child class, deprecated since 8.4: ' . $method->isPublic() . "\n"; class Bar extends Foo // 2 levels of inheritance { public function __construct() { parent::__construct(); } } $method = new Bar(); echo 'ReflectionMethod not called directly, triggers deprecation on Foo indirectly, checking Bar is out of scope for sniff: ' . $method->isPublic() . "\n";
Output for git.master_jit, git.master
Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in /in/pf4lE on line 13 Signature 1 called in a child class, deprecated since 8.4: 1 Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in /in/pf4lE on line 13 ReflectionMethod not called directly, triggers deprecation on Foo indirectly, checking Bar is out of scope for sniff: 1

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:
27.69 ms | 406 KiB | 5 Q