As indicated in the documentation on inheritance, PHP
requires that classes be defined before they are used.
In terms of a class that extends another class, the
parent should be defined before the child. Earlier
versions of PHP (and indeed the current version) may
have been lenient on this point, but most opcache
engines enforce the stricter ordering requirement.
As indicated in the documentation on inheritance, PHP requires that classes be defined before they are used. In terms of a class that extends another class, the parent should be defined before the child. Earlier versions of PHP (and indeed the current version) may have been lenient on this point, but most opcache engines enforce the stricter ordering requirement.
References: