Skip to content

Regression: DNF parameter (I1&I2)|C compile fails on Intersection (follow-up #4956) #6741

Closed

Description

@PurHur

Summary

Closed #4956 regressed: parenthesized DNF parameter types combining an intersection arm with a class arm — (I1&I2)|C $x — fail at compile time with Unknown Op\Type provided: PHPCfg\Op\Type\Intersection.

Capability matrix marks DNF types as VM/JIT/AOT yes (#3094), and compliance types/dnf_param_intersection_class.phpt is red.

php-src reference

  • Zend/zend_compile.c — zend_compile_type() / DNF type arms
  • lib/DnfType.php, lib/Compiler.php — TypeReconstructor / resolveOpType for Union_ + Intersection

Repro

./script/docker-exec.sh -- bash -lc 'php test/repro-maintainer/parity_dnf_param_intersection_class_regression.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro-maintainer/parity_dnf_param_intersection_class_regression.php'
php vendor/bin/phpunit --filter dnf_param_intersection

Zend prints C. VM: parseAndCompile failure: Unknown Op\Type provided: PHPCfg\Op\Type\Intersection.

Repro: test/repro-maintainer/parity_dnf_param_intersection_class_regression.php

Expected (php-src-strict)

  • Compiles and accepts new C() when C implements I1, I2.
  • Rejects incompatible values with catchable TypeError (dnf_param_intersection_class_type_error.phpt).
  • JIT/AOT call-site DnfParamCheck mirrors VM.

Implementation hints (PHP-in-PHP)

Done when

  • dnf_param_intersection_class.phpt + type_error PHPT green on VM
  • JIT compile/execute for the accepting case

Related

Activity

  1. added
    enhancementNew feature or request
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jun 6, 2026
  2. PurHur commented on Jun 6, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-c — starting this run

  3. PurHur commented on Jun 6, 2026

    @PurHur
    OwnerAuthor

    Merged via #6782.

    The (I1&I2)|C DNF parameter compile path was already fixed in #6391 (#4956). This PR adds the maintainer repro script and PHPUnit unit guard from the issue spec so the regression stays locked.

    Verification (all green):

    • php test/repro-maintainer/parity_dnf_param_intersection_class_regression.php → C
    • vendor/bin/phpunit --filter dnf_param_intersection → OK (4 tests, VM + JIT compliance)
    • vendor/bin/phpunit test/unit/DnfParamIntersectionClassRegressionTest.php → OK (2 tests)
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

    area:compilerCompiler / CFG / JITarea:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions