You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
551 B

27 years ago
  1. <?
  2. class BaseClass {
  3. var $class_name = "BaseClass";
  4. function BaseClass($value) {
  5. print "value is '$value'\n";
  6. }
  7. function MyClassName() {
  8. return $this->class_name;
  9. }
  10. };
  11. class ChildClass {
  12. var $class_name = "ChildClass";
  13. function ChildClass($value, $new_value) {
  14. BaseClass::BaseClass($value);
  15. print "new value is '$new_value'\n";
  16. }
  17. function MyClassName($a_value) {
  18. return BaseClass::MyClassName()." and the value is '$a_value'";
  19. }
  20. };
  21. $obj = new ChildClass("Test", "Another test");
  22. print $obj->MyClassName("not interesting");