3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Entity { class File { private $foo; } class FileInbox { private $file; public function setFile(File $file) { $this->file = $file; } } } namespace Entity\FileInbox { class File { private $bar; } } $fileInbox = new Entity\FileInbox();
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.29, 5.6.7 - 5.6.13
Fatal error: No code may exist outside of namespace {} in /in/0uE1D on line 23
Process exited with code 255.

preferences:
185.31 ms | 1400 KiB | 63 Q