Skip to content

Assertion during enum compilation #8777

Closed
@dstogov

Description

@dstogov

Description

The following code:

<?php
enum y : string {
    case y = __FILE__;
}

Resulted in this output:

Zend/zend_compile.c:9712: zend_compile_const_expr_magic_const: Assertion `ast->attr == T_CLASS_C' failed.
Aborted (core dumped)

I'm not sure what this should produce. PHP-8.1 parser passes this code.

PHP Version

master

Operating System

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions