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.16, 8.5.0 - 8.5.1
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.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.29
signature 1, unchanged: 1 signature 2, deprecated in PHP 8.4: 1

preferences:
58.68 ms | 407 KiB | 5 Q