Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always generate fatal error for LSP failures #4000

Open
wants to merge 1 commit into
base: master
from

Conversation

2 participants
@nikic
Copy link
Member

commented Mar 28, 2019

RFC: https://wiki.php.net/rfc/lsp_errors

When a method signature (LSP) check during inheritance fails, always generate a fatal compile error. Previously, this generated either a warning or a fatal error based on the following rules:

  • If the method signatures have an incompatible return type, generate a fatal error.
  • If the prototype of the method is abstract (or part of an interface), generate a fatal error.
  • Otherwise, generate a warning. Prior to PHP 7.0 a strict standards warnings was generated.

This change removes the distinction between abstract and non-abstract methods and always generates a fatal error.

@nikic nikic added the RFC label Mar 28, 2019

@nikic nikic force-pushed the nikic:inheritance-error branch from 214943d to bc1eaaf Mar 28, 2019

Class D extends C { function f(array $a) {} }
?>
==DONE==
--EXPECTF--
Warning: Declaration of D::f(array $a) should be compatible with C::f($a) in %s on line 5
Array hint, should be nothing.
==DONE==

This comment has been minimized.

Copy link
@morrisonlevi

morrisonlevi Apr 8, 2019

Contributor

The ==DONE== looks like it was removed from expected text, but not from the program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.