Category Archives: PHP

General Array Sorting in PHP

December 23rd, 2005
Posted in PHP | No Comments

PHP offers several array sorting functions. These array sorting functions sort array values only ( “sort” ), rearrange array values by sorting the array key ( “ksort” ), or rearranging array keys by sorting the array values ( “asort” ). Reverse sort functions rsort, krsort, and arsort are also available. In addition to these simple […]

Polymorphism in PHP

December 8th, 2005

While thinking about a programming language deficiency, I rediscovered polymorphism. Overloading a function allows a function call to behave differently when passed variables of different type. I was trying to devise a method of simulating function overloading, because PHP does not support it. I considered implementing a function with an if-else statement ladder that tests […]

Misguided Response on XML-RPC Worm

November 15th, 2005

A recent worm, Lupper, is traversing the Internet and exploiting computers that run the XML-RPC package for PHP. The official XML-RPC for PHP homepage states that the package’s abuse of the PHP eval function created a security hole that allowed remote execution of arbitrary code. This means that any systems that run PHP and a […]

Function Overloading and PHP

August 3rd, 2005

I’m proud of writing elegant code that can be easily read and intuitively understood. I use whitespace to increase my code’s readability, and I utilize simple, specialized programming language constructs to make my code more concise. For example, I’ll use PHP’s foreach construct, instead of a traditional for loop, to eliminate unnecessary indexers. This construct […]