3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Broken { function foo(){} } $func = (new Broken)->foo(...); $rm = new ReflectionMethod(new Broken, 'foo'); $rm->invoke($func);
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught ReflectionException: Given object is not an instance of the class this method was declared in in /in/4UiEW:11 Stack trace: #0 /in/4UiEW(11): ReflectionMethod->invoke(Object(Closure)) #1 {main} thrown in /in/4UiEW on line 11
Process exited with code 255.

preferences:
52.63 ms | 406 KiB | 5 Q