3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Broken { function foo(){} } $func = (new Broken)->foo(...); $rm = new ReflectionMethod(new Broken, 'foo'); $rm->invoke($func);
Output for 8.2.31 - 8.2.32, 8.3.0 - 8.3.32, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
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.31 ms | 771 KiB | 4 Q