Sorry for the delayed reply, I was away for long.
Even though I am parsing through 5 directories with approx 15 files in each, the inclusion of the template file, which is done in the header of the page, actually slows the page from loading significantly.
From what I understand so far, when a page is parsed, the stylesheet that we include must be parsed as a whole before any output is generated. I am assuming that the template data is stored in some kind of temporary place.
Now, since I include a PHP file that will take the time to parse through the direcotries and then spit out the file, the page waits that the script is ready, no output is generated. Then, when it is generated, It stalls when it reads it into memory,
and only then it proceeds to parse the body of the page.
This is of course my off top of my head guess, and explanation for the slowdown caused by my script.
(My RSS feeds parser takes less time "no time", and this one has to connect to remote sources and read and parse...)
But then again, It is possible that my hosting company which let's just say does not have a good uptime and reliability record, that Is making fun of me.
As for my Passing by reference, I got confused with C programming when I did the above, That's why I was asking, I mean it worked, and you do not need the return statement,
but I was trying both methods and forgot about it
I basically got confused by C's pointers, it's much easier in php lol
So for the script above, what I did is I wrote some mroe functions to make stylesheets depending on which page is loaded (now there is less weight/style) and I also parse it only when I make changes to the styles, run the script and it generates all the styles.
It's a good compromise in the end.