This is the behavior of SAPI
"The destructors that are called when the script completes are already sent with HTTP headers. The working directory during the script completion phase may be different from some SAPIs (like Apache)."
From http://php.net/manual/en/language.oop5.decon.php
But, as mentioned in other answers, there are many ways to get the current relative path. If you changed it at run time, be sure to check somewhere inside the object.