There is no basis whatsoever, except that that kind of lunacy wasn't seen during the entire duration of the Cold War, where the stakes were much higher and where the West was actively looking for an edge to take out the Soviet Union. And vice versa.
Chances are largely that he's bluffing, but there is no way to be 100% certain. What he wants to happen is 100% clear however: the West should lose its nerve and allow him to have his way.
Mind you, China would probably not take kindly either to him lobbing a bomb somewhere so would drop their so far limited support like a hot potato. No one gains if the planet gets reduced to cinders.
On the other hand, those threats also make it clear that both sides have to go back to their much more circumspect dance moves during said Cold War: NATO-on-Russia combat can't be allowed to happen.
You are also taking the "declaration of war" a bit out of context.
Putin was out doing a photo op with some stewardess trainees and speaking to his domestic audience. My bolding
Russian President Vladimir Putin has described sanctions imposed by Western nations over his invasion of Ukraine as "akin to a declaration of war".
"But thank God it has not come to that," he added.
Mr Putin also warned that any attempt to impose a no-fly zone over Ukraine would be seen as participation in the armed conflict.
Reminding us that a no-fly zone means war, on the other hand, is only reminding us of what we should already know.