Typehints and = null
I just committed a patch to PHP CVS which allows you to do the following:
<?php class foo { } function bla( foo $blah = null ) { var_dump( $blah ); } $f = new foo; bla( $f ); bla(); bla( null ); ?>
Comments
THANK YOU! Will it be in 5.1 ?
Yes, it will be in PHP 5.1.0.
I was hoping this would be added.
Thank you for making my life a little bit easier. Now I can be even LAZIER with doc comments :D
I'm going to assume that this will be in 6.0 as 5.1 has Release Candidates out.
That is what he just said. :)
No, I said that this will be in PHP 5.1.0 too.
Shortlink
This article has a short URL available: https://drck.me/ta-n-47q