2.2.2使用self访问父类中的函数

<?php
/**
* 2.2.2使用self访问父类中的函数
* @authors haidong (admin@zhe700.net)
* @date 2015-03-23 13:59:05
* @version $Id$
*/

class MyObject {

function myBaseMethod(){
echo "I am baseObject";
}
}
class MyExtendObject extends MyObject{
function myExtendMethod(){
echo "I am Extend Object ";
self::myBaseMethod();//调用父类中的函数
}
}
$instance = new MyExtendObject();
$instance->myExtendMethod();

原文地址:https://www.cnblogs.com/haidong/p/4359715.html