Calling get_parent_class() without arguments is deprecated

Description

Using null as a parameter for the get_class() and get_parent_class() native call is deprecated since PHP 8.3. Using the null value defaulted to the current class, so it is possible to use $this instead.

Example

<?php

get_parent_class();

?>

Solutions

  • Use $this as an argument.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See get_classWithoutArgument.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See get_classWithoutArgument.

Static Analysis

This error may be tracked down with the following static analysis rules: Structures/GetClassWithoutArg.