Function Overloading in PHP

Update: I have written about a more Java-like, argument based overloading solution here.

I’ve been trying to get a set of good basic functions included within my PHP framework and ran across a nice little trick to allow function (without a class) overloading, the code should speak for itself.

This will be the default file.

if(!function_exists("overloadableFunc") ) {
  function overloadableFunc() {
    echo "foo";

and this will be in the overloading file (needs to be included before the default.

function overoadableFunc() {
  echo "foobar";

Drug Arrest Ethics

Recently a group of Australians was arrested in Bali for trying to smuggle 11kg of Heroin into Australia. What makes it interesting to me is that the Australian Federal Police provided the intelligence to the Indonesian police so that they could make the arrests. This basically has sentenced the perpetrators (some or all of who are Australian citizens) to death.

Personally, I think letting the Indonesian’s do the arrests is the right thing to do but is it possible that the information be provided under a premise it is life imprisonment, not the death sentence. In saying that, I don’t think any more tension needs to be created between Indonesia and Australia.

The term AJAX

Matt Haughey writes about the noise surrounding the term AJAX. I agree with him wholeheartedly and wanted to add, that searching for information that is the conglomeration of Javascript+DHTML+XML has suddenly become a dream as now everyone is tagging the technology set as the same thing. Personally, I think it’s a win-win situation.

Windows Messenger Flaw

I (and the network I administer) use Windows Messenger for Instant Messaging, I actually quite like the software, it’s one of the few examples of Microsoft doing something simple and right, this coupled with the fact it seems to be one of the few programs that will integrate with Live Communication Server make it the only real choice. I’ve really only just realised that you can’t attach a message saying, “Hey it’s Gally.” when you are adding a contact to your list. Maybe it doesn’t really matter, cause I’ve been using it for a good 4 years and only just noticed.