3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function func() { echo 'I am the parent'; } } class Bar extends Foo { public function func() { echo 'I am the child'; } } // Create instance of child class $bar = new Bar; // Create reflection class $reflected = new ReflectionClass(get_class($bar)); // Get parent method $method = $reflected->getParentClass()->getMethod('func'); // Invoke method on child object $method->invokeArgs($bar, []);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
173.15 ms | 2182 KiB | 10 Q