Skip to content

Fix undefined array key warnings in openswoole/swoole card templates#39

Merged
tillkruss merged 2 commits into
v3.xfrom
copilot/fix-undefined-array-key-issues
Mar 5, 2026
Merged

Fix undefined array key warnings in openswoole/swoole card templates#39
tillkruss merged 2 commits into
v3.xfrom
copilot/fix-undefined-array-key-issues

Conversation

Copilot AI commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

preg_match result arrays are accessed at index [1] without checking for a match, causing PHP warnings when a feature key (e.g. json, curl-native, postgres) is absent from php --ri output.

  • Add null coalescing fallback (?? 'disabled') to all 13 preg_match result accesses across card-openswoole.phtml (7) and card-swoole.phtml (6)
# before
preg_match("/^json => (.+)/m", $openswoole, $json); echo $json[1];

# after
preg_match("/^json => (.+)/m", $openswoole, $json); echo $json[1] ?? 'disabled';

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…oole.phtml

Use null coalescing operator (??) with 'disabled' fallback on all
preg_match result accesses to prevent "Undefined array key 1" warnings
when a regex pattern doesn't match the php --ri output.

Co-authored-by: tillkruss <665029+tillkruss@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix undefined array key warnings in card-openswoole Fix undefined array key warnings in openswoole/swoole card templates Mar 5, 2026
@tillkruss tillkruss marked this pull request as ready for review March 5, 2026 21:46
@tillkruss

Copy link
Copy Markdown
Member

@dhobi do you happen to know if they renamed these or why it's suddenly not mentioned anymore?

@tillkruss

Copy link
Copy Markdown
Member
openswoole

OpenSwoole => enabled
Author => OpenSwoole Group <hello@openswoole.com>
Version => 26.2.0
Built => Mar  5 2026 13:51:40
coroutine => enabled with boost asm context
kqueue => enabled
rwlock => enabled
http2 => enabled
hook-curl => enabled
pcre => enabled
zlib => 1.2.12

Directive => Local Value => Master Value
openswoole.enable_coroutine => On => On
openswoole.enable_preemptive_scheduler => Off => Off
openswoole.use_fiber_context => Off => Off
openswoole.display_errors => On => On
openswoole.unixsock_buffer_size => 262144 => 262144

@tillkruss tillkruss merged commit 1f212b6 into v3.x Mar 5, 2026
15 checks passed
@tillkruss tillkruss deleted the copilot/fix-undefined-array-key-issues branch March 5, 2026 21:53
tillkruss added a commit that referenced this pull request Mar 5, 2026
…39)

Co-authored-by: tillkruss <665029+tillkruss@users.noreply.github.com>
tillkruss added a commit that referenced this pull request Mar 5, 2026
* heroku-22, heroku-24, php 8.1 - 8.5 with latest (#32)

- Drops (unsupported) heroku-20 stack
- Adds heroku-24 stack
- Adds php 8.4 (20240924)
- Adds php 8.5 (20250925)
- Refactor build process
- Fixed undefined array key warnings in openswoole/swoole card templates (#39)

Co-authored-by: tillkruss <665029+tillkruss@users.noreply.github.com>
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