final_ctor2.phpt 539 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. ZE2 cannot override final old style ctor
  3. --FILE--
  4. <?php
  5. class Base
  6. {
  7. public final function Base()
  8. {
  9. }
  10. }
  11. class Works extends Base
  12. {
  13. }
  14. class Extended extends Base
  15. {
  16. public function __construct()
  17. {
  18. }
  19. }
  20. ReflectionClass::export('Extended');
  21. ?>
  22. --EXPECTF--
  23. 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
  24. Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d