Tweeter button
Facebook button

Multiple Constructors (Overloading) in PHP

It is a huge frustration to me that PHP does not support constructor overloading in the same way that other OOP (Object Orientated Programming) languages do.  There is a workaround, however:

class MultipleConstructor {

private $info = ”;

function __construct() {
$argv = func_get_args();

switch( func_num_args() ) {
default:
case 1:
self::__construct1($argv[0]);
break;
case 2:
self::__construct2( $argv[0], $argv[1] );
break;
}
}

function __construct1($value) {
$this->info = $value;
}

function __construct2($value, $value2) {
$this->info [...]

Save Energy with Blackle

Blackle – Energy-Saving Search

While browsing around today, I found Blackle.

Blackle is an “energy saving” seach engine, powered by Google.  According to the website, this site saves energy when you search because:

Blackle saves energy because the screen is predominantly black. Image displayed is primarily a function of the user’s color settings and desktop graphics, as [...]