Thread: Type casting
View Single Post
Old 05-26-2008, 03:53 PM   #13 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

You can look at it like this.

If a variable was a room where a party was going on, the equal is the door, and the (int) typecast would be the guard at the door. ($room = (guard) $partygoer) He does not change the type of room it is or the people inside it, all he does is only let people with money go in. Same thing goes with that command, $var = (int) value; does not modify the variable, it filters what goes in.
__________________

Village Idiot is offline  
Reply With Quote