Blog Posts

PHP Performance & Benchmarking: Testing String Variables

Jun 11, 2007 - Elliott Brueggeman
Though various development books have their own opinion of using strlen(), empty(), and isset() (most say don't use strlen to validate strings because of performance considerations), I have always wondered as to their factual validity now that PHP is in its fifth incantation.

PHP Performance & Benchmarking: Testing Numeric Variables

May 31, 2007 - Elliott Brueggeman
When validating numeric user input, I usually use the PHP function is_numeric(). Often though, I am really looking for an integer and not merely a numeric value.

PHP Performance & Benchmarking: Random Array Element Access: rand() vs. array_rand()

May 24, 2007 - Elliott Brueggeman
Often during development you come upon a situtation where you have to randomly pick an element from an array. The PHP guys did us a favor and created the array_rand() function, but I suspected it wasn't as fast as it could be.

PHP Performance & Benchmarking: Testing Boolean Variables

May 11, 2007 - Elliott Brueggeman
Testing booleans is a common code occurance in programs, and I have been trying to be a good programmer and use $var===true (=== means exactly equal, == means equivalent.) However, I also worry about performance, and I suspect that using the exactly equal to comparison is slowing down scripts where

PHP Performance & Benchmarking: PHP Loop comparisons: for, while, and do while loops

Apr 25, 2007 - Elliott Brueggeman
This is a problem that pertains to every programmer, and over thousands of lines of code, performance slow downs can really add up based on a programmer's loop preference.

Create a PHP Tag Cloud

Apr 24, 2007 - Elliott Brueggeman
You've probably seen a tag could or browse tags page before, but for those who haven't, it resembles a paragraph of links, with each link larger or smaller depending on the popularity of that item.

PHP Performance & Benchmarking: PHP remote file access: fopen() and file_get_contents()

May 4, 2005 - Elliott Brueggeman
Opening files in PHP is easier now because of the file_get_contents() function which is the recommended way to dump a file's contents into a string according to the official PHP documentation. But does this PHP function really perform better than fopen?