final_ctor1.phpt 548 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. ZE2 cannot override final __construct
  3. --FILE--
  4. <?php
  5. class Base
  6. {
  7. public final function __construct()
  8. {
  9. }
  10. }
  11. class Works extends Base
  12. {
  13. }
  14. class Extended extends Base
  15. {
  16. public function Extended()
  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; Extended has a deprecated constructor in %s on line %d
  24. Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d