Skip to content

Infinite recursion through deprecated class constants self-referencing through deprecation message #17711

Closed

Description

@iluuu1994

Description

The following code:

<?php

const TEST = 'Message';

class C {
    #[\Deprecated(self::C)]
    const C = TEST;
}

var_dump(C::C);

Resulted in this output:

Segfault

But I expected this output instead:

Deprecated constant C::C
string(7) "Message"

PHP Version

PHP 8.4

Operating System

No response

Activity

  1. self-assigned this
    on Feb 5, 2025
  2. added a commit that references this issue on Mar 26, 2025
    272f7f7
  3. added 2 commits that reference this issue on May 25, 2025
    6260e33
    cd751f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions