Skip to content

cli: passing PHP_HTTP_PARSER_STRICT build option doesn't work #24697

Closed

Description

@akku1139

Description

The strict-mode switch name differs between the header and the implementation, so all STRICT_CHECK() sites are compiled out.
The header logic is also inverted: passing -DPHP_HTTP_PARSER_STRICT reduces the value to 0 instead of enabling strict mode.
As a result, "strict mode" cannot be enabled by any build option.

  • Request line ending with bare LF -> 200 (expected: reject)
  • Header line ending with bare LF -> 200 (expected: reject)
  • Blank line ending with bare LF -> 200 (expected: reject)
  • HTTP/9.9 -> 200, and the response status
    line echoes "HTTP/9.9 200 OK"
  • HTXP/1.1, HXXP/1.1 (protocol name typo) -> 200 (expected: reject)
  • HTTP/1.1 without Host -> 200 (expected: 400)

AI Attribution: found by GPT-6 Luna, tested by DeepSeek V4.1 Flash

PHP Version

PHP 8.7.0-dev (cli) (built: Oct 26 2026 01:58:06) (NTS)
Copyright © The PHP Group and Contributors
Zend Engine v4.7.0-dev, Copyright © Zend by Perforce
    with Zend OPcache v8.7.0-dev, Copyright ©, by Zend by Perforce

Operating System

No response

Activity

  1. changed the title [-]sapi/cli: PHP_HTTP_PARSER_STRICT is defined but never referenced, so STRICT_CHECK() is always a no-op[/-] [+]cli: passing PHP_HTTP_PARSER_STRICT build option doesn't work[/+] on Oct 25, 2026
  2. added 4 commits that reference this issue on Oct 26, 2026
    470af31
    61156b6
    aad2266
    7d3a57a
  3. added a commit that references this issue on Oct 27, 2026
    a31751c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions