Issue Bug Resolved

#111260PHPStan 2.3.3 reports CRLF constant as not found

Oliver Bartsch 10/28/26, 07:50 updated 10/28/26, 08:05

Description

The nightly builds of main,< 14.3 and 13.4 fail in the phpstan job after composerInstallMax raises phpstan/phpstan from 2.3.2 to 2.3.3:

Constant CRLF not found.

CRLF is only defined at runtime in SystemEnvironmentBuilder::defineBaseConstants() via “defined(‘CRLF’) ?: define(‘CRLF’, CR . LF);”. Before 2.3.3, PHPStan discovered the constant from that define() call. 2.3.3 changed global constant discovery (phpstan/phpstan-src#6756) and the constant is no longer found.

LF and CR are not affected, because Build/phpstan/phpstan-constants.php already declares them.

Fix: declare CRLF in Build/phpstan/phpstan-constants.php as well.

Reproduce:
./Build/Scripts/runTests.sh -s composerInstallMax -p 8.5
./Build/Scripts/runTests.sh -s phpstan -p 8.5>

Reviews 3

History 14

  1. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-28T08:05:14+00:00" > 10/28/26, 08:05 </span>

    Applied in changeset commit:e4430476a5e264bd8eb257aa09955f46f0b6d0b4.