摘要: php类型约束函数的参数可以指定为对象、数组,注意,即使使用了类型约束,如果使用null作为参数的默认值,那么在调用函数的时候可以使用mull作为实参例子<?phpClass MyClass{ public function test(OtherClass $otherclass){ echo $otherclass->var; } public function testArray(array $input_array){ print_r($input_array); }}class OtherClass{ public $var='hello';}$myclas 阅读全文
posted @ 2012-11-19 08:56 hylaz 阅读(1550) 评论(0) 推荐(0) 编辑