Skip to content

A class declared under if (\false) fails to lower, while if (false) compiles: "unsupported statement kind Class". #625

Closed

Description

@blacktrs

Reported in #614 (item 9). Seen in google/apiclient src/aliases.php and nikic/php-parser compat stubs (Node/Expr/ArrayItem.php).

<?php
class Real {}
if (\false) {
    class Legacy extends Real {}
}
echo "ok\n";

php 8.5: ok · manticore 0.18.0: MIR.lower: unsupported statement kind Class at line 4

Fixed on branch wordpress (unmerged): cdd17ee7 (conditional declaration hoisting); repro verified green with that branch's binary. Constant folding of a fully-qualified \false/\true/\null is still worth a direct test.

Activity

  1. added
    bug
    on Nov 10, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions