-
Notifications
You must be signed in to change notification settings - Fork 819
Open
Labels
Category: EngineStatus: Needs TriagebugDocumentation contains incorrect informationDocumentation contains incorrect information
Description
Description
The following code:
<?php
spl_autoload_register(function ($class_name) {
var_dump($class_name);
});
class_exists('\\');
Resulted in this output:
string(0) ""
But I expected NO output instead.
This seems unexpected. Calling class_exists('');
does not trigger the autoload callback, but a single backslash in the class name does (as does invoking method_exists('\\', 'test')
, etc.)
I might be wrong but I can't think of a reason why to invoke the callback in this case, in fact, composer fails because it assumes that $class_name
is never empty.
PHP Version
8.2 (and others)
Operating System
Debian 11
Metadata
Metadata
Assignees
Labels
Category: EngineStatus: Needs TriagebugDocumentation contains incorrect informationDocumentation contains incorrect information