<?php
class MyObject {
function myBaseMethod() {
echo "I am declared in MyObject\n";
}
}
class MyOtherObject extends MyObject {
function myExtendedMethod() {
echo "myExtendedMethod is declared in MyOtherObject\n";
self::myBaseMethod();
}
}
MyOtherObject::myExtendedMethod();
//myExtendedMethod is declared in MyOtherObject
//I am declared in MyObject
self
原文:http://www.cnblogs.com/yhdsir/p/4649147.html