Skip to content

class_exists() / interface_exists() / trait_exists() with a runtime name answer false for a different-case spelling php accepts #603

Closed

Description

@blacktrs

Summary

class_exists() / interface_exists() / trait_exists() with a runtime name answer false for a different-case spelling php accepts.

Repro

<?php
namespace App\Deep;
trait T1 {}
class C {}
interface I {}
$names = ['app\deep\c', 'APP\DEEP\C', 'app\deep\i', 'app\deep\t1'];
foreach ($names as $n) {
    var_dump(\class_exists($n, false), \interface_exists($n, false), \trait_exists($n, false));
}

Expected (php)

bool(true)
bool(false)
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)

Actual (manticore da74c724, Darwin arm64)

bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)

Tracking

Known-bug repro: tests/aot/repro/wrong/class_exists_case_insensitive.php — bash tests/aot/xfail.sh -k class_exists_case_insensitive reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    wrong-answer
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions