3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Entity {} class FooEntity extends Entity {} abstract class Repository { abstract public function getDetail(): Entity; } class FooRepository extends Repository { public function getDetail(): FooEntity { return new FooEntity; } } $obj = new FooRepository(); $obj->getDetail();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
164.92 ms | 3304 KiB | 8 Q