Skip to content

Regression: pipe operator |> accepted on PROFILE=8.4 — Zend 8.4/8.5-only parse (re-#16675, Zend/zend_language_parser.y) #22792

Closed

Description

@PurHur

Category

Regression: · php-src-strict · profile gate (re-#16675 / re-#18007 / re-#7219)

Problem

|> is a PHP 8.5 language feature (php.net 8.5 release). Under PHP_COMPILER_PROFILE=8.4, VM parses and evaluates pipes; Zend 8.4 must parse-error (same as Zend 8.2 reference). Prior issues gated the operator on 8.4 by mistake.

Repro Zend 8.2.32 / Zend 8.4 VM PROFILE=8.4 (2026-07-24)
"hello" |> strtoupper(...); Parse error: unexpected token ">" prints HELLO

master@0ae5abab2.

php-src reference

PHP implementation target

  • Gate pipe desugar/parse in lib/ (PipeOperatorDesugar / parser) on languageProfileVersion() >= 8.5.0 only
  • PHP_COMPILER_PROFILE=8.4 and default 8.2 reference: Zend-shaped parse error
  • Keep working under PHP_COMPILER_PROFILE=8.5

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/pipe84.php <<\"PHP\"
<?php
echo \"hello\" |> strtoupper(...), PHP_EOL;
PHP
php /tmp/pipe84.php; echo EXIT_ZEND:$?
PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/pipe84.php; echo EXIT_VM84:$?
PHP_COMPILER_PROFILE=8.5 php bin/vm.php /tmp/pipe84.php; echo EXIT_VM85:$?'

Done when

  • PROFILE=8.4 / default: parse error; no HELLO
  • PROFILE=8.5: prints HELLO
  • Compliance guard; php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 24, 2026
  2. PurHur commented on Jul 24, 2026

    @PurHur
    OwnerAuthor

    Maintainer context

    Filed after local Zend-vs-VM probes on master@0ae5abab2. Pillar 1 still red on gen-0 (#22642 / PR #22717); these profile-gate tickets are Pillar 4 backlog for workers once trust is green enough to merge parity PRs.

  3. PurHur commented on Jul 24, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-B — starting this run (pipe operator PROFILE=8.4 parse gate)

  4. PurHur commented on Jul 24, 2026

    @PurHur
    OwnerAuthor

    Merged in #22809

    Verification

    • PROFILE=8.4 / default: parse error unexpected token ">", exit 255 (no HELLO)
    • PROFILE=8.5: prints HELLO, exit 0
    • PHPUnit: testSupportsPipeOperator* + pipe_operator VM compliance (forward 8.5 / profile84 reject / reference) — OK

    Gate: supportsPipeOperator() now requires languageProfileVersion() >= 8.5.0.

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 / JITbugSomething isn't workingimplementation-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