3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { function myMethod() {} } $method = ReflectionMethod::createFromMethodName('MyClass::myMethod'); echo 'named constructor, added in 8.3: ' . $method->isPublic() . "\n";
Output for 8.3.0 - 8.3.29, 8.4.1 - 8.4.16, 8.5.0 - 8.5.1
named constructor, added in 8.3: 1
Output for 8.1.34, 8.2.0 - 8.2.30
Fatal error: Uncaught Error: Call to undefined method ReflectionMethod::createFromMethodName() in /in/inbS7:8 Stack trace: #0 {main} thrown in /in/inbS7 on line 8
Process exited with code 255.

preferences:
69.25 ms | 407 KiB | 5 Q