3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __construct() { echo "Foo"; } } class Bar {} new ReflectionMethod(Foo::class, "__construct"); new ReflectionMethod(Bar::class, "__construct");
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught ReflectionException: Method Bar::__construct() does not exist in /in/mOTEF:10 Stack trace: #0 /in/mOTEF(10): ReflectionMethod->__construct('Bar', '__construct') #1 {main} thrown in /in/mOTEF on line 10
Process exited with code 255.

preferences:
263.05 ms | 1135 KiB | 4 Q