Luxeritas PHP8.3 調査まとめ(2026-05)

調査目的

Luxeritas fork を:

  • PHP 8.3
  • WordPress latest
  • wp-env + Docker
  • WSL2

環境で動作確認し、

  • fatal
  • warning
  • deprecated
  • WP-CLI compatibility

を調査する。


構築環境

sandbox 環境

場所:

~/Claude/private/luxeritas/wp-sandbox

構成:

項目内容
OSWSL2 Ubuntu
RuntimeDocker Desktop
Toolwp-env
PHP8.3
WordPresslatest
ThemeLuxeritas fork mount
DBclean install
Plugins未投入

wp-env 構成

.wp-env.json

主構成:

{
  "phpVersion": "8.3",
  "testsEnvironment": false,

  "themes": [
    "../themes/luxeritas",
    "../themes/luxech"
  ],

  "mappings": {
    "wp-content/themes/luxeritas": "../themes/luxeritas",
    "wp-content/themes/luxech": "../themes/luxech",
    "wp-content/imports": "./imports"
  },

  "config": {
    "WP_DEBUG": true,
    "WP_DEBUG_LOG": true,
    "WP_DEBUG_DISPLAY": false,
    "SCRIPT_DEBUG": true
  }
}

初期トラブル

Docker WSL Integration

問題:

/var/run/docker.sock 不可

原因:

Docker Desktop の WSL Integration 無効。

対応:

Docker Desktop
→ Settings
→ Resources
→ WSL Integration
→ Ubuntu ON

wp-env 起動問題

“core": “latest"

問題:

Invalid or unrecognized source: "latest"

原因:

現行 wp-env 仕様非対応。

対応:

core 行削除

.wp-env.json 編集ミス

問題:

luxeritas/.wp-env.json

を編集していた。

実際に使用されていたのは:

luxeritas/wp-sandbox/.wp-env.json

wp-env は:

カレントディレクトリ

.wp-env.json を使用。


wp-env 起動成功

最終構成:

Container役割
wordpress開発用 WordPress
mysqlMariaDB
cliwp-cli

testsEnvironment: false
により tests-* container は無効化。


PHP8.3 Warning 調査

発生 warning

PHP Warning:
Trying to access array offset on null

発生箇所:

FileLine
functions.php53
functions.php67
functions.php85
functions.php92
functions.php226
functions.php245
inc/const.php17
inc/widget.php1803
inc/widget.php2245

root cause 分析

結論

原因は:

WP-CLI bootstrap 時の scope 問題

詳細

WP-CLI は:

WP_CLI\Runner::load_wordpress()

内部から:

require 'wp-settings.php'

を実行。

PHP の include/require は:

呼び出し元 scope を継承

する。

そのため:

$_is['ssl'] = is_ssl();

等が:

$GLOBALS['_is']

ではなく、

load_wordpress() local scope

へ格納される。

後続 callback 側では:

global $_is;

により $GLOBALS['_is'] を参照。

しかし:

$GLOBALS['_is'] 未初期化

のため:

Trying to access array offset on null

warning 発生。


重要な切り分け

項目結論
clean install 特有かNO
DB import で直るかNO
browser access で発生するか基本 NO
PHP8.3 固有かNO
PHP7系ではNotice 相当で潜伏

評価

良い点

Luxeritas は:

PHP8.3 で fatal 崩壊していない

確認できた。

問題は:

bootstrap scope warning

中心。


修正案比較

Option A(推奨)

inc/global-const.php

へ:

global $luxe, $_is, $fchk, $default_set, $widget_concat, $awesome;

追加。


理由

  • root cause 修正
  • 変更量最小
  • wp-cli 対応
  • future PHP 対応
  • CI/automation 対応
  • AI tooling 対応

Option B

各箇所を:

$_is['admin'] ?? false

化。


非推奨理由

  • warning suppress に近い
  • 根本原因未修正
  • 修正箇所増大
  • 他 global state 問題が残る

AIレビュー結果

Claude系

強み:

  • root cause 収束
  • phase 分離
  • minimal fix

Gemini

強み:

  • 設計レビュー
  • global state 管理視点
  • 長期保守観点

提案:

$_is だけでなく他 global variable も global 宣言

OpenClaw + Codex/gpt-5.5

強み:

  • call stack 分析
  • scope behavior 分析
  • $luxe 等への波及分析

結論:

global state 全体を global 化

推奨。


最終結論

今回の問題は:

PHP8.3 incompatibility

というより、

Luxeritas の
「WordPress browser bootstrap 前提」

が、

WP-CLI / modern tooling

環境で可視化されたもの。


今後の意味

今回の対応は:

  • PHP8.4
  • wp-cli
  • CI
  • Docker
  • wp-env
  • AI automation

への適応の第一歩となる。