<?php
namespace a {
class className
{ }
}
namespace b {
class className
{ }
}
It will cause the title described warning.

Same thing with constants.
I know this is superfluous/redundant but having more information never hurt anyone.
:)
namespace a {
const constantName = 1;
}
namespace b {
const constantName = 2;
}

Same issue
if(true)
{
define('SOME_CONST','ONLINE');
}
else
{
define('SOME_CONST', 'OFFLINE');
}
Duplicate symbol declaration 'SOME_CONST'.intelephense(10002)

Most helpful comment
Same issue
if(true) { define('SOME_CONST','ONLINE'); } else { define('SOME_CONST', 'OFFLINE'); }