3v4l.org

run code in 500+ PHP versions simultaneously
<?php class SomeClass { function methodInjection() {} public function get() { return new ReflectionMethod(...$this->methodInjection(...)); } } $obj = new SomeClass(); var_dump($obj->get());
Output for 8.5.7
Fatal error: Uncaught TypeError: Only arrays and Traversables can be unpacked, Closure given in /in/gO5mO:10 Stack trace: #0 /in/gO5mO(15): SomeClass->get() #1 {main} thrown in /in/gO5mO on line 10
Process exited with code 255.
Output for 8.1.34
Fatal error: Uncaught TypeError: Only arrays and Traversables can be unpacked in /in/gO5mO:10 Stack trace: #0 /in/gO5mO(15): SomeClass->get() #1 {main} thrown in /in/gO5mO on line 10
Process exited with code 255.
Output for 7.0.18
Parse error: syntax error, unexpected ')' in /in/gO5mO on line 10
Process exited with code 255.

preferences:
54.4 ms | 489 KiB | 4 Q