3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { function myMethod() {} } $method = new ReflectionMethod('MyClass', 'myMethod'); echo 'signature 1, unchanged: ' . $method->isPublic() . "\n"; $method = new ReflectionMethod('MyClass::myMethod'); echo 'signature 2, deprecated in PHP 8.4: ' . $method->isPublic() . "\n";
Output for 8.4.1 - 8.4.14
signature 1, unchanged: 1 Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in /in/hv24N on line 11 signature 2, deprecated in PHP 8.4: 1
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.27
signature 1, unchanged: 1 signature 2, deprecated in PHP 8.4: 1

preferences:
45.28 ms | 407 KiB | 5 Q