结象范例化时不加new行吗

WBOY
Release: 2016-06-13 12:09:57
Original
841 people have browsed it

结象实例化时不加new行吗
看到有人这么写$_sxe=simplexml_load_file('text.xml');
这样写到底是函数还是对象呢
------解决思路----------------------
simplexml_load_file 是一个函数
而 simplexml_load_file 返回的数据是一个对象
两者没有冲突啊。

例如:foo是方法,返回的是一个对象。

<br />function foo(){<br />    $ret = array(<br />        'name' => 'fdipzone'<br />    );<br />    return (object)$ret;<br />}<br /><br />$obj = foo();<br />echo $obj->name; // fdipzone<br />
Copy after login

Related labels:
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