The tilde is interpreted as a special character by the shell, so using it inside PHP code won't work regardless of OS.
If you're trying to access something relative to a user home directory you could try getenv() - I'm pretty sure Windows sets an environment variable equivalent to $HOME.