WordPress / WordPress/php-ai-client

PHP 7.4.0-7.4.11 fatal due to covariant return type bug in php-ai-client DTOs

Open
#240 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
308
Forks
84
Avg merge
7d 21h
Merged PRs (30d)
2

Description

The plugin declare PHP 7.4+ support, but on PHP 7.4.0 the AI Client DTO inheritance pattern can fatal with:

Declaration of GenerativeAiResult::fromArray(array $array): GenerativeAiResult must be compatible with WithArrayTransformationInterface::fromArray(array $array): WithArrayTransformationInterface

This appears to be PHP bug (80126), fixed in PHP 7.4.12:

https://bugs.php.net/bug.php?id=80126
https://www.php.net/ChangeLog-7

So the practical minimum for the PHP SDK path may be PHP 7.4.12+, not PHP 7.4.0+.

Could the compatibility docs/plugin headers/runtime checks clarify that PHP 7.4.12+ is required for the PHP AI Client SDK path, or add a guard/admin notice for PHP 7.4.0-7.4.11?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the compatibility documentation, plugin headers, and runtime-check locations for the PHP AI Client SDK, then confirm how PHP 7.4.0-7.4.11 is currently handled. Done should clearly communicate the PHP 7.4.12+ requirement or provide an appropriate guard/admin notice, with the affected version range covered by validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.