Skip to content

The autoloader throws an exception on class_exists #20773

Closed
@sidolov

Description

@sidolov

Summary (*)

The autoloader throws an exception on class_exists. That is clearly an unexpected behavior according to the documentation: http://php.net/manual/en/function.class-exists.php

This will cause issues when including third-party libraries that are not written for Magento.

An autoloader that throws an exception is not PSR-4 compliant

Examples (*)

Run class_exists('FooFactory'). It should return false but an error is thrown instead.

To reproduce the issue apply changes from the #14085

Expected result: there is no error thrown
Actual result: autoloader throws an exception

@Vinai, @kandy, @orlangur I moved content from the #14085 to current issue.

Proposed solution

Metadata

Metadata

Assignees

Labels

Component: Framework/CodeEvent: mm19inFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions