PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Possible polymorphic call

Last modified: 16 May 2022

Reports polymorphic code usages. Such usages are ambiguous and can be potentially inoperable depending on the class instance passed as the argument.

In the following example, the $property property is only defined in ChildClass but not in ParentClass. As a result, the getProperty() function call is operable when a ChildClass instance is passed as an argument, but inoperable when a ParentClass instance is passed.