The beauty of PHP is that people can modify it to work however they want due to it’s open sourced nature…
If something annoys you about the programming language itself, you can just go ahead and change it. The upside to that is that you get the features you think are missing in PHP. The downside is that your code can potentially become incompatible with everyone else, and your code becomes quite unportable.
Nonetheless, Ilia Alshanetsky (author of php|architect’s Guide to PHP Security
) has posted on his blog a patch of PHP 5.3 that provides proper, traditional, type hinting, currently unsupported for scalar types.
As he explains, type hinting is a controversial topic; what with the fluidity of PHP and it’s loosely-typed nature. However I think type hinting, especially strict type hinting would be more advantageous than disadvantageous. He explains how his patch adds a certain amount of flexibilty for numbers within strings (using the “numeric” pseudo-type) allowing a string to be passed off as a number (perfectly legal in PHP… e.g. “1″ + “1″ = 2), or alternatively using the stricter “int” type to specify a number and must be of integer type i.e. “1″ is not valid, but 1 is.
Unfortunately I don’t like delving into compiling stuff, so I’ll just have to hope it gets included in the main trunk of PHP… until then I can pretend I have type hinting, perhaps by adding comments such as this messy mess… *ahem*:
function foo(/* int */ $bar)
I’m an advocate of tidy, well commented code, and something that has bugged me for a little while was the messiness of the ternary operator (?:) in PHP. With the introduction of PHP 5.3.0, we can now miss out the duplication messiness of using the ternary operator for existance checks for example. Instead of:
$value = $a_value ? $a_value : $b_value;
We can now simply do:
$value = $a_value ?: $b_value;
It goes without saying that one should still not nest ternary operators as they become messy and extremely difficult to understand, even with good commenting. Consider an if/elseif/else or switch instead.
There are a few other things in PHP 5.3.0 that I’m looking forward to as well, one of which is the bundling of ext/phar which is really rather cool.
There are other dubious things, which are covered (and argued) in great detail elsewhere such as the goto operator and the introduction of namespaces…
This sort of thing really angers me and displays the fact that the web developers of the Parcelforce website will happily display total ineptitude at developing websites. To block off an entire operating system for no reason whatsoever, is simply astounding, and I can’t believe companies still employ such idiots.
Why should I not be allowed to send a parcel, just because I use Linux? There is no reason for it – especially as they support Mozilla Firefox! There is no difference between Windows Firefox and Linux Firefox, and no reason to stop me using Linux to send a parcel. Thankfully plug-ins like the User Agent Switcher exist, to circumvent such inept and naive programming.

Update: User Agent Switcher didn’t work. I used Firebug to enable the submit button though, which let me through happily…