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.23, 8.5.6 - 8.5.8
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.32
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:
47.3 ms | 549 KiB | 4 Q