<?php class father{
function __construct(){
echo"I am a father.<br>";
}
}
class son extends father{
function son1(){
echo"I am a son.<br>";
}
}
$peo=new son();
?>请问输出结果是什么?程序的执行步骤?非常感谢!
function __construct(){
echo"I am a father.<br>";
}
}
class son extends father{
function son1(){
echo"I am a son.<br>";
}
}
$peo=new son();
?>请问输出结果是什么?程序的执行步骤?非常感谢!
解决方案 »
- osCommerce换服务器要如何配置呢
- 求php编程原理的书名
- apmserv的file_get_contents
- 急急急!上传文件有时可以有时失败
- 怎么才能知道,自己我select 已经查的有数据?,怎么才能知道自己的update语句已经更新完成?怎么才能知道自己人的deltue已经成功执行.
- 变量怎么转换成数组里面的内容
- 请教一下PHP高手
- php怎样读表单中的空格换行!在线等,高分~~~~
- php连不上mysql,怎么办?多谢!
- [求助][急]关于SQL语句优化
- 菜鸟百分求助,关于php页面莫名出现空白行的原因,如果能够完美解决,追加100分
- 求助 如何提高这个简单函数的效率 关于从WEB上查找结果的。
<?php
class A{
function test(){
echo "hello!";
}
}
class B extends A{//若A类和B类不在同一文件中 请包含后(include)再操作
function test2(){
parent::test();//子类调用父类方法
echo "test2";
}
}
$a = new B();
$a->test();//hello!
$a->test2();//hello!test2
?>