Type Casting variables in PHP: Is there a practical example?
- by Stephen
PHP, as most of us know, has weak typing. For those who don't, PHP.net says:
PHP does not require (or support) explicit type definition in variable declaration; a variable's type is determined by the context in which the variable is used.
Love it or hate it, PHP re-casts variables on-the-fly. So, the following code is valid:
$var =…