note 86921 deleted from language.oop5.typehinting by danbrown
| From: | danbrown@php.net | Date: | Tue, 08 Sep 2009 16:16:18 +0000 |
| Subject: | note 86921 deleted from language.oop5.typehinting by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160305@lists.php.net to get a copy of this message | ||
Note Submitter: will at nielsendigital dot com
----
comments at ignorethis netweblogic com wrote:
Note that you cannot add a type hint and give a default value, apart from arrays. You will get an
internal server error, or fatal error.
e.g.
<?php
//Wont work
function test(ObjName $obj = ''){
//.....
}
I believe the following should work:
function test(ObjName $obj = null){
//.....
}