用require可以引用自定义的类,用use引用自定义的类去总报错说没找到引用类?

WBOY
Release: 2016-06-06 20:28:17
Original
1121 people have browsed it

用require可以引用自定义的类,用use引用自定义的类去总报错说没找到引用类?
我PHP是5.5.12的呢,网上说use得php5.3才可以用,但我都5.5了,怎么还用不了?

回复内容:

用require可以引用自定义的类,用use引用自定义的类去总报错说没找到引用类?
我PHP是5.5.12的呢,网上说use得php5.3才可以用,但我都5.5了,怎么还用不了?

我怀疑题主认为用了namespace就不用手动加载文件了。

按照官网下面的评论,即时使用namespace也是要手动加载文件的

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