Repository navigation
php 8.4 compatibility - #218
Merged
Merged
Conversation
Closed
for PHP 8.4 and 8.5 compatibility
PHP 7.1 is now the minimum supported version - the ?Type nullable syntax required for PHP 8.4 compatibility is not available on older versions. PHP 8.4 and 8.5 are added as experimental (allowed to fail).
match updated PHPUnit_Framework_Constraint::fail() signature after phpunit 3.7.44 removed type hints for PHP 8.4 compatibility
add explicit ?Type syntax to all 277 implicitly nullable parameters across 156 files, using PHP-CS-Fixer's nullable_type_declaration_for_default_null_value rule. PHP 8.4 deprecated implicit nullable (`Type $param = null`), requiring explicit `?Type $param = null` instead.
the ?Type nullable syntax required for PHP 8.4 compatibility is only available from PHP 7.1 onwards https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated
no longer needed with php 7.1 minimum
…219) php 8.4 changed SplPriorityQueue::insert() return type to `true`. Without the attribute, class inheritance triggers a fatal error.
…rays (#221) xml_set_object() is deprecated in php 8.4. Pass array($this, 'method') callables directly to xml_set_element_handler() and xml_set_character_data_handler() instead.
…csv() (#222) php 8.4 requires the $escape parameter to be explicitly provided as its default value will change in a future version. https://php.watch/versions/8.4/csv-functions-escape-parameter
…oding (#223) $actualEncoding is deprecated in php 8.4, it was an alias for $encoding.
…8.4+ (#224) disabling session.use_only_cookies is deprecated in php 8.4. The test still verifies session option overrides via remember_me_seconds, and retains the use_only_cookies coverage on php <8.4.
falkenhawk
marked this pull request as ready for review
April 3, 2026 12:19
Merged
This was referenced Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full PHP 8.4 compatibility for zf1s. Bumps minimum PHP version from 5.3 to 7.1.
A
1.15.xbranch has been created from the last 5.3-compatible release (1.15.6) for projects that can't upgrade yet.Why the version bump
Up until now, this fork maintained compatibility with the full range of PHP versions down to 5.3. That was always a core principle - keep the barrier to entry as low as possible for legacy projects.
PHP 8.4 deprecated implicit nullable parameter declarations (
Type $param = null), requiring?Typesyntax which is only available from PHP 7.1. An ingenious alternative approach exists, as proven by @marcing (see #207), but in the end bumping to 7.1 was chosen as the most reasonable path - see detailed explanation in PR #216.What changed
Version bump and dependencies:
symfony/polyfill-php70(no longer needed)zf1s/phpunitto 3.7.44,zf1s/dbunitto 1.3.4fail()overrides to match updated phpunit signaturePHP 8.4 deprecation fixes:
#[\ReturnTypeWillChange]toSplPriorityQueue::insert()(php 8.4: [zend-stdlib] add ReturnTypeWillChange to SplPriorityQueue::insert() #219)xml_set_object()with callable arrays (php 8.4: [zend-translate] replace deprecated xml_set_object() in translate adapters #221)$escapeparameter tofgetcsv()(php 8.4: provide explicit escape parameter to fgetcsv() #222)DOMDocument::$actualEncodingwith$encoding(php 8.4: [zend-feed] replace deprecated DOMDocument::$actualEncoding with $encoding #223)use_only_cookies=falsein test on PHP 8.4+ (php 8.4: [zend-session] skip deprecated use_only_cookies=false in test #224)E_STRICTconstant usage for PHP 8.4+ (PHP 8.4: E_STRICT constant deprecated #205)Test results
PHP 8.4: 16879 tests, 0 errors (24 incomplete, 610 skipped - all pre-existing).