Skip to content

Assertion when fetching property of "bad" magic constant #9136

Closed
@dstogov

Description

@dstogov

Description

The following code:

<?php
const C = __file__->foo;

Resulted in this output:

zend_compile.c:9852: zend_compile_const_expr_magic_const: Assertion `ast->attr == T_CLASS_C' failed.

But I expected this output instead:

Fatal error: Constant expression contains invalid operations

PHP Version

master

Operating System

any

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions