Skip to content

Add stress example for autoload + reflection + case-insensitive class lookup #282

Description

@nahime0

Why

This combines multiple surfaces that already work individually but are riskier together:

  • static autoload discovery
  • class_exists() / literal class loading
  • case-insensitive class lookup
  • ReflectionClass construction from a differently-cased name
  • attribute metadata lookup on the autoloaded class

This is a good candidate for catching resolver/name-resolution drift or reflection/autoload mismatches.

Proposed stress program

<?php
spl_autoload_register(function ($name) {
    if ($name === "Demo\\Thing") {
        require __DIR__ . "/DemoThing.php";
    }
});

if (class_exists("demo\\thing")) {
    $r = new ReflectionClass("DEMO\\THING");
    $attrs = $r->getAttributes();
    echo $r->getName() . "\n";
    echo count($attrs) . "\n";
    echo $attrs[0]->getName() . "\n";
}

What to verify

  • Autoload is triggered consistently from the literal class probe.
  • Canonical class identity survives case folding.
  • Reflection sees the same declaration that autoload resolved.
  • Attribute lookup matches the resolved class name and preserves PHP-visible behavior.

Scope

Track as stress coverage first; no confirmed bug yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions