Let's say I want to fetch contents from a URL using a PHP script.
One way to do that would be to use PHP function such as
echo file_get_contents("http://www.example.com/file.xml");
Another way would be to use UNIX tools such as wget or curl, or any other tool accessible from shell
echo exec("wget http://www.example.com/file.xml");
Is there a significant performance difference between using exec() and PHP build-in functions to achieve same thing, assuming that both UNIX tools and PHP functions have similar implementation and perform with same efficiency?
What exactly happens when you call an exec() function in terms of resources? Does it actually create a new shell session, or does it run on top of the current php shell session?