可变函数 可变类名 都可以

WBOY
Release: 2016-06-23 13:31:13
Original
829 people have browsed it

可变函数 可变类名 都可以 

class my{public static function say(){echo 'hello';}$o='my';$o::say();//这样可以调用 就是可变类名吧?‘my’::say();//这样为什么就报错了呢? 上面变量里面也不是保存‘my’这个字符串吗? 为什么上面的行下面的不行了呢? 同样的值哦}
Copy after login


回复讨论(解决方案)

首先  你的单引号不对吧 ‘my’ 和'my'

单引号我改回来了!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!