I have some issues when sharing URLs with Twitter.
I share http://google.com using following URL
https://twitter.com/share?text=hello&url=http://google.com
output is given below.

But when I try to share http://google
with following URL
https://twitter.com/share?text=hello&url=http://google
Twitter can’t correctly display the sharing URL as given below.
Do you have any idea?
You have these mixed up, it’s the other, proper way around.
https://twitter.com/share?&text=hello&url=http://google.com – will work.
https://twitter.com/share?&text=hello&url=http://google – won’t work.
As to your edit which seems to have switched them around, the answer is this. It shouldn’t work with the one you seemingly think is ‘broken’ because you’re not providing a valid URL for the URL parameter (one with a specific TLD).