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.4.9 - 8.4.24, 8.5.6 - 8.5.9
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, 8.2.31 - 8.2.32, 8.3.5 - 8.3.33
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:
55.61 ms | 552 KiB | 4 Q