Skip to content

CI, PHP 8.1-8.4 support, and array columns in rows (relanded #18 + #19)#20

Merged
jdatcmd merged 7 commits into
masterfrom
php-compat-ci
Jul 6, 2026
Merged

CI, PHP 8.1-8.4 support, and array columns in rows (relanded #18 + #19)#20
jdatcmd merged 7 commits into
masterfrom
php-compat-ci

Conversation

@jdatcmd

@jdatcmd jdatcmd commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Relands #18 and #19 (GitHub closed #18 un-merged when its stacked base branch was deleted; #19 had already merged into this branch). Contents unchanged from the reviewed PRs, both of which passed the full 11-job CI matrix:

  • GitHub Actions matrix (PG 11–18 × PHP 8.3, PG 18 × PHP 8.1/8.2/8.4)
  • PHP 8.1–8.4 compatibility + hardening against host php.ini (opcache/JIT off, xdebug neutralized, error_reporting forced)
  • Array-typed columns inside rows arrive as PHP arrays (Convert array columns inside rows to PHP arrays #19; behavior change → 2.3)

🤖 Generated with Claude Code

ChronicallyJD and others added 7 commits July 5, 2026 18:09
A GitHub Actions matrix builds PL/php and jsonb_plphp and runs the
full regression suite on PostgreSQL 11-18 (distro PHP 8.3) plus PHP
8.1, 8.2, and 8.4 (ondrej PPA) against the newest PostgreSQL, for
every push to master and every pull request.

PHP compatibility fixes found while widening the matrix:

- PHP 8.1: php_module_startup still took an additional-modules count;
  add a version guard.  Also #error explicitly below 8.1, where the
  zend_error_cb signature differs.
- PHP 8.4: fgetcsv deprecates omitting $escape; the cookbook's CSV
  recipe now passes explicit arguments.
- The Makefiles now prefer the libphp matching PHP_CONFIG's version
  when several are installed.  Note (INSTALL): some packagings give
  every libphpX.Y.so the same SONAME (libphp.so), so the backend
  loads whatever that symlink points at regardless of the version
  linked -- keep one embed package installed, or point the symlink.

The suite passes on PHP 8.1, 8.2, 8.3, and 8.4 (each with the
matching runtime); documented range updated from "8.x" to 8.1-8.4.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Actions runner image sets create_main_cluster=false, so installing
postgresql-N does not create one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pg_regress runs as postgres, which could not reach the checkout
through /home/runner.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The host's php.ini must not decide which errors reach our
zend_error_cb or how they are routed: hardcode error_reporting=E_ALL,
display_errors/log_errors off, and disable opcache (whose JIT adds
nothing for our one-shot eval'd functions).  GitHub's runner images
ship a PHP with opcache+JIT enabled for CLI, which silently dropped
notices and reduced every error message to "fatal error".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extensions loaded from the host's php.ini (xdebug, notably, which the
GitHub runner images preconfigure) hook zend_error_cb during startup,
swallowing the warnings and notices PL/php forwards to the client.
Re-assert our callback after request startup and at the top of every
handler invocation (a pointer assignment, effectively free), and set
xdebug.mode=off alongside the other hardcoded INI values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An array-typed column used to cross into PHP as its literal text form
("{a,b}") everywhere a whole row converts: $_TD['new']/['old'] in
triggers, rows from spi_fetch_row/spi_fetchrow/spi_each, and the
fields of composite-type arguments.  Route those column values through
the same conversion arguments already get, so they arrive as real PHP
arrays -- and, since the reverse path (plphp_zval_get_cstring with
do_array) already renders PHP arrays back into array literals,
assigning an array works too, e.g. modifying $_TD['new']['tags']
before returning MODIFY.

This matches PL/Perl, which converts row fields recursively.  It is a
behavior change for code that string-parsed the literal form, noted in
the CHANGELOG.  Composite-typed columns inside rows still arrive as
text (converting those needs a record parser; possible follow-up).

New cases in the arrays test cover SPI rows, cursor rows, triggers
(read + append + MODIFY round trip), and composite argument fields.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Convert array columns inside rows to PHP arrays
@jdatcmd
jdatcmd merged commit c61e782 into master Jul 6, 2026
11 checks passed
@jdatcmd
jdatcmd deleted the php-compat-ci branch July 6, 2026 01:17
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