1--TEST-- 2A function and a class with the same name work as expected 3--FILE-- 4<?php 5 6function Something(): string 7{ 8 return 'Another'; 9} 10 11class Something {} 12 13class Another {} 14 15echo Something() . PHP_EOL; 16var_dump(new Something()); 17var_dump(new (Something())); 18 19?> 20--EXPECT-- 21Another 22object(Something)#1 (0) { 23} 24object(Another)#1 (0) { 25} 26