3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Entity { use Entity\FileInbox\File; class File { private $foo = 'top'; } class FileInbox { public $file; public function setFile(File $file) { $this->file = $file; } } } namespace Entity\FileInbox { class File { private $foo = 'nested'; } } namespace Test { use Entity\FileInbox; use Entity\FileInbox\File; $fileInbox = new FileInbox(); $fileInbox->setFile(new File()); var_dump($fileInbox->file->foo); }

This is an error 404

There are `0` results


preferences:
151.46 ms | 1399 KiB | 7 Q