I was getting strange negative figures so I modified the script and got the following
Time to open 40MB file with relative path: 0.15625ms
Time to open 40MB file with fixed path: 0.140625ms
the script was modified to :-
<?php
$start = microtime();
$var = file_get_contents('H:\Program Files\Abyss Web Server\htdocs\demo.txt');
$end = microtime();
echo "Time to open 40MB file with fixed path: " . ($end-$start) . "ms";
?>
I had the output dumped in to a variable because it is more likely that this would be the scenario on a production server, the 40MB file was produced with the supplied script unchanged.
Unless your script is going to offer up a service that millions of people will be relying on, the minute difference of 1/100th of a second is not going to make that much difference but it will if your server is going to be serving millions of users, the 1/100th of a second difference will make a big difference.
I noted a small variance in both methods, this was approximately 3/100ths of a second over a short period of time.
That was a pretty interesting exercise and experiment and would be interesting to find others who are willing to try both scripts and see what results are gained.
My local machine used to run XAMPP but because developers have basically crippled it with silly security, I dumped it and installed Abyss (which is made by former Apache developers if you look in to the history of the departure!) and PHP 5.4