You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A class/trait declared in both arms of if (Cls::CONST >= n) is refused: the class-constant guard is not folded. #621
A class/trait declared in both arms of if (Cls::CONST >= n) is refused: the class-constant guard is not folded.
Repro
<?php// reported in #614 (sentry/sentry Monolog compat traits)class Logger { constAPI = 3; }
if (Logger::API >= 3) {
trait Compat { publicfunctionv() { return"v3"; } }
} else {
trait Compat { publicfunctionv() { return"v2"; } }
}
class H { use Compat; }
echo (newH)->v(), "\n";
Expected (php)
v3
Actual (manticore c421455f, Darwin arm64)
compile failed (rc=65):
compile failed: MIR.lower: unsupported statement kind Class at line 8
compile: front-end (parse/typeck/IR) returned null (rc=65)
Tracking
Known-bug repro: tests/aot/repro/wrong/conditional_decl_class_const_guard.php — bash tests/aot/xfail.sh -k conditional_decl_class_const_guard 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