The short answer is no.
A slightly longer answer is that you can create your own Value object to use as a hint, but that means you will need to return the object instead of an array.
class Foo {}; class Bar {}; class Baz { private $foo; private $bar; public function __construct(Bar $bar, Foo $foo) { $this->bar = $bar; $this->foo = $foo; } public function getFoo() : Foo { return $this->foo; } public function getBar() : Bar { return $this->bar; } } function myFn() : Baz { return new Baz(new Bar(), new Foo()); } $myObj = myFn(); var_dump($myObj);
Note. This requires PHP 7+ to prompt return types.
source share