News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

WebDevLogs.com:
Which way to get the PHP self script name is the fastest?
January 12, 2007 @ 15:36:00

From the WebDevLogs.com blog today, there's some benchmarking results from Mgcci's look at PHP's methods for grabbing some common data - the script's own name. This includes the "magic" call to __FILE__:

The result shows that __FILE__ is the fastest, so use that when you don't have to use any other method to find the script's self. __FILE__ is a built in constant show the location of the running script.

He gives the benchmark output (time measurement) and includes the code that he used to perform the tests.

0 comments voice your opinion now!
sheel script name fastest benchmark results sheel script name fastest benchmark results


blog comments powered by Disqus

Similar Posts

Hasin Hayder's Blog: Counting occurrence of a word in a String - Benchmarking of PHP functions

Builder.com.au: PHP exploit code plants itself in GIF

SitePoint PHP Blog: PHP Frontend for Xdebug Profiling?

Builder.com.au: PHP exploit code plants itself in GIF

Pierre-Alain Joye's Blog: Debugging symfony (or any php script) with vim and Xdebug


Community Events





Don't see your event here?
Let us know!


api podcast configure developer bugfix community series laravel threedevsandamaybe wordpress release application introduction library interview list language install symfony code

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework