<?php
class parentClass {
function myChild() {
echo 'Child Class Name: '.__CLASS__;
}
}
class childClass extends parentClass {
}
$childClassObj = new childClass;
$childClassObj->myChild();
输出是
Child Class Name: parentClass
实际上,我期待一个输出
Child Class Name: childClass
我应该怎么做才能得到输出?