Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Union types not supported in PHP ^7.3 #1

Closed
tdiam opened this issue Feb 24, 2022 · 1 comment
Closed

Union types not supported in PHP ^7.3 #1

tdiam opened this issue Feb 24, 2022 · 1 comment

Comments

@tdiam
Copy link

tdiam commented Feb 24, 2022

Description

Union types (like array|string) were introduced in PHP 8.0, so the package breaks in PHP ^7.3.

Steps to Reproduce

  1. Copy the README code to a WordPress codebase.
  2. Run with PHP 7.x.

Expected behavior:

Runs properly.

Actual behavior:

Fatal error: Uncaught Error: syntax error, unexpected '|', expecting variable (T_VARIABLE)

Versions

All versions.

@idleberg
Copy link
Owner

idleberg commented Feb 24, 2022

Thank you, I had no idea and followed my TypeScript habbits. I have removed the union types temporarily in v0.3.1 and plan to re-introduce them in November, when the minimum version will be bumped to PHP 8.0. Looking at the supported versions, I will also bump the minimum version to PHP 7.4 in the next release.

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

No branches or pull requests

2 participants