Tip
After upgrading, run tyhp build --verbose to see detailed output including any configuration options that are using default values. This helps you discover new options that may be relevant to your project.
This page provides guidance on upgrading between Tyhp versions. As Tyhp evolves, new features may be added and syntax may change. This guide helps you navigate those transitions smoothly.
Tyhp uses semantic versioning (MAJOR.MINOR.PATCH). The compiler MAJOR encodes the highest PHP version this release supports, as <php-major><php-minor-two-digits> — 805 means PHP 8.5 and below, not “Tyhp 8.x targets PHP 8.x”. MINOR carries Tyhp language and compiler change (including deprecation and, after notice, removal of Tyhp syntax). PATCH is non-breaking fixes. See Release Planning and VERSIONING.md.
Tyhp 805 understands PHP 8.5 syntax (pipe |>, (void) cast, clone(…) / clone-with, attributes on top-level const, and related 8.4 parse completions). When output.phpVersion is set below the introducing PHP minor, the emitter rewrites those constructs for the lower target — you do not need to rewrite source solely to keep an older emit target.
When upgrading to a new version of Tyhp, follow these steps:
The tyhp lint command is your primary tool for identifying upgrade issues. Run it after updating the compiler to get a complete list of errors and warnings:
# Check the entire project
tyhp lint
# Get machine-readable output for CI
tyhp lint --format=json
# Check a single file
tyhp lint --file=src/MyClass.tyhp
Tyhp follows a deprecation cycle for breaking changes. When a feature or syntax is deprecated:
805.N.0), the deprecated feature is removed. Removal does not wait for the next PHP ceiling / MAJOR (806.0.0).Address deprecation warnings promptly so you are ready when that MINOR lands.
When a new PHP version introduces syntax that conflicts with Tyhp syntax, Tyhp follows a defined migration path. See the New Syntax Creation page for the detailed process. In summary: first integrate-and-detect (keep both syntaxes if possible); then deprecate Tyhp’s conflicting form with compile-time options; then remove the old syntax in a later MINOR. Do not wait for the next MAJOR.
New Tyhp versions may introduce new configuration options in tyhp.json. The compiler uses sensible defaults for all options, so your existing configuration will continue to work. However, you may want to review new options to take advantage of new features.
After upgrading, run tyhp build --verbose to see detailed output including any configuration options that are using default values. This helps you discover new options that may be relevant to your project.
After a major Tyhp upgrade, review your tyhpdef files for compatibility. Automatic regeneration (tyhp generate_tyhpdef) is not in this alpha. Update stubs by hand, and bump tyhp/php when a new stubs package is published.