The PHP page executes `echo ("< script > window.open ('xxx'); < / script >"); `has no effect?

I have a test.php code:

<?php
echo ("<script>window.open("http://www.baidu.com");</script>");

when I execute it, why not open the Baidu page?
but if you make a button click event to open it, then you can succeed.

Php
Apr.28,2021

Direct open will be blocked by the browser. Location can jump

echo ("<script>window.location = 'http://www.baidu.com';</script>");
Menu