programming
Baby, Don't You Loose Your Type On Me
Submitted by greg.harvey on Fri, 29/08/2008 - 17:30Many programmers from beyond the realm of PHP, deep in the black country where the dragons reside, whinge like an Australian swim-coach about PHP's loose variable typing. Many PHP developers either don't know what this means or don't care. I didn't much care, until recently, where I got a practical lesson in why loose typing can, on ocassion, really suck.
Here are some interesting effects of PHP's loose typing:
<?php
$var1 = 1;
$var2 = '1';
print 'Result: '.($var1 == $var2);
?>