ctor_name_clash.phpt 515 B

1234567891011121314151617181920212223
  1. --TEST--
  2. ZE2 The child class can re-use the parent class name for a function member
  3. --FILE--
  4. <?php
  5. class base {
  6. function base() {
  7. echo __CLASS__."::".__FUNCTION__."\n";
  8. }
  9. }
  10. class derived extends base {
  11. function base() {
  12. echo __CLASS__."::".__FUNCTION__."\n";
  13. }
  14. }
  15. $obj = new derived();
  16. $obj->base();
  17. ?>
  18. --EXPECTF--
  19. Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; base has a deprecated constructor in %s on line %d
  20. base::base
  21. derived::base