View Single Post
Old 01-31-2010, 05:23 AM   #1 (permalink)
andformore
The Wanderer
 
andformore's Avatar
 
Join Date: Dec 2009
Posts: 17
Thanks: 2
andformore is on a distinguished road
Default Type Hinting in PHP 6

So, as far as i understand, php 5.whatever we're currently on supports type hinting in classes when you're dealing either with arrays or objects. But, it doesn't allow us to declare variable types of methods which accept strings, ints, booleans, and these basic types.

I read somewhere that there is a debate over whether or not they should include this in php 6. What do you all think?

Personally, I think it would be nice to have the option of writing classes this way just because I think it makes the code more self documenting and easier to deal with for future developers or my future self who might have no idea what i was doing when i wrote something.

I don't know what the downside would be.

Thoughts?
__________________
Something interesting... If you visit one of my sites today, you'll probably double my unique visitors for the day! Shameless Plugs:
My Blog My Octopus Game My Flash Card Website
andformore is offline  
Reply With Quote