Home > Backend Development > PHP Tutorial > 为啥下面这个函数中的值是对象呢

为啥下面这个函数中的值是对象呢

WBOY
Release: 2016-06-23 13:45:37
Original
830 people have browsed it

public function -run($type){    $type->version();    $type->work();}
Copy after login

函数的值怎么能是函数呢,函数的值到底是怎么规定的


回复讨论(解决方案)

函数的参数可以是任何数据(当然你可以自己限定)
在你示例的代码中 $type 就是一个对象

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template