您的位置:首页 > 编程语言 > PHP开发

PHP的范围解析操作符(::)的含义分析说明

2011-07-03 22:21 751 查看
<?php class A { function example() { echo "I am the original function A::example().<br />\n"; } } class B extends A { function example() { echo "I am the redefined function B::example().<br />\n"; A::example(); } } // A 类没有对象,这将输出 // I am the original function A::example().<br /> A::example(); // 建立一个 B 类的对象 $b = new B; // 这将输出 // I am the redefined function B::example().<br /> // I am the original function A::example().<br /> $b->example(); ?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  范围解析