Skip to content

php 8.4 compatibility - #218

Merged
falkenhawk merged 13 commits into
masterfrom
php84-compat
Apr 8, 2026
Merged

falkenhawk merged 13 commits into
masterfrom
php84-compat

Conversation

@falkenhawk

@falkenhawk falkenhawk commented Apr 3, 2026 •

Copy link
Copy Markdown
Member

Full PHP 8.4 compatibility for zf1s. Bumps minimum PHP version from 5.3 to 7.1.

A 1.15.x branch 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 ?Type syntax 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:

  • bump minimum PHP to 7.1
  • update CI test matrix: drop PHP <7.1, add 8.4 and 8.5 as experimental
  • drop symfony/polyfill-php70 (no longer needed)
  • bump zf1s/phpunit to 3.7.44, zf1s/dbunit to 1.3.4
  • [zend-test] remove type hints from fail() overrides to match updated phpunit signature

PHP 8.4 deprecation fixes:

Test results

PHP 8.4: 16879 tests, 0 errors (24 incomplete, 610 skipped - all pre-existing).

@falkenhawk falkenhawk mentioned this pull request Apr 3, 2026
falkenhawk and others added 12 commits April 3, 2026 14:11
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
falkenhawk marked this pull request as ready for review April 3, 2026 12:19
@falkenhawk
falkenhawk requested a review from partikus April 3, 2026 19:52
@falkenhawk falkenhawk mentioned this pull request Apr 7, 2026
@falkenhawk
falkenhawk merged commit fe2ca87 into master Apr 8, 2026
10 checks passed
@falkenhawk
falkenhawk deleted the php84-compat branch April 8, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants